An ex-convict living in Shanghai’s Yangpu district has been sentenced to 42 months in prison for endangering the lives of his neighbors while he attempted to commit suicide.