As his nisba shows, he came from the locality of Jarjaraya, south of Baghdad.[1] He came to Egypt along with his brother, and held a succession of offices in the Fatimid bureaucracy.[1] He entered the service of Sitt al-Mulk, before becoming secretary to the police chief of Cairo. He was convicted of disloyalty when he opened letters of the secret services in 1013, as a result of which his hands were cut off. However the Caliph al-Hakim soon regretted this harsh punishment, and took him back into the palace and promoted him to high office.