YES! In case someone runs into the same issue, here the jenkins.service that solved my problem
[Unit] Description=Jenkins - open source automation server [Service] ExecStart=/etc/init.d/jenkins start ExecStop=/etc/init.d/jenkins stop GuessMainPID=no IgnoreSIGPIPE=no KillMode=process LimitNOFILE=64000 LimitNPROC=64000 ProtectHome=true ProtectSystem=full RemainAfterExit=yes TimeoutSec=5min Type=oneshot [Install] WantedBy=multi-user.target KillExcludeUsers=root jenkins based on this <https://github.com/konstruktoid/hardening/issues/23#issuecomment-379497599> post The issue seems to be that systemd kills the user processes when starting jenkins with systemctl. I wrote a jenkins .service file and added the Jenkins user to KillExcludeUsers in /etc/systemd/logind.conf; https://gist.github.com/konstruktoid/1bc96c4f5030f37bd5f5142cc2718b35 What a nightmare. Never had so much issue installing something on unix. I'm just a developer but fortunately I love unix enough to not give up ^__^ Ciao! On Friday, November 8, 2019 at 3:37:35 PM UTC+1, gianpaolo wrote: > > Hi Dirk > I re-installed everything. It seems a little bit better. Service comes up > and comes down immediately. > Related to pam session as you suggested? > > ov 08 15:32:35 ci systemd[1]: Started Jenkins - open source automation > server. > Nov 08 15:32:36 ci jenkins[2637]: Correct java version found > Nov 08 15:32:36 ci jenkins[2637]: * Starting Jenkins Automation Server > jenkins > Nov 08 15:32:36 ci su[2678]: Successful su for jenkins by root > Nov 08 15:32:36 ci su[2678]: + ??? root:jenkins > Nov 08 15:32:36 ci su[2678]: pam_unix(su:session): session opened for user > jenkins by (uid=0) > Nov 08 15:32:36 ci su[2678]: pam_unix(su:session): session closed for user > jenkins > Nov 08 15:32:37 ci jenkins[2637]: ...done. > Nov 08 15:32:37 ci jenkins[2711]: Correct java version found > Nov 08 15:32:37 ci jenkins[2711]: * Stopping Jenkins Automation Server > jenkins > Nov 08 15:32:38 ci jenkins[2711]: ...done. > root@ci:~# su - jenkins > jenkins@ci:~$ > > > On Friday, November 8, 2019 at 3:25:36 PM UTC+1, Dirk Heinrichs wrote: >> >> Am Freitag, den 08.11.2019, 01:46 -0800 schrieb gianpaolo: >> >> jenkins[3540]: chown: changing ownership of '/var/run/jenkins': Operation >> not permitted >> >> su[3580]: PAM audit_log_acct_message() failed: Operation not permitted >> >> su[3580]: pam_authenticate: System error >> >> jenkins[3540]: su: System error >> >> su[3580]: FAILED su for jenkins by root >> >> su[3580]: - ??? root:jenkins >> >> jenkins[3540]: ...fail! >> >> >> Looks like a problem with your PAM setup. Can you login as root and then >> "su - jenkins" from the shell? >> >> Bye... >> >> Dirk >> >> -- >> >> *Dirk Heinrichs* >> Senior Systems Engineer, Delivery Pipeline >> OpenText ™ Discovery | Recommind >> *Phone*: +49 2226 15966 18 >> *Email*: [email protected] >> *Website*: www.recommind.de >> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach >> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, >> Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646 >> This e-mail may contain confidential and/or privileged information. If >> you are not the intended recipient (or have received this e-mail in error) >> please notify the sender immediately and destroy this e-mail. Any >> unauthorized copying, disclosure or distribution of the material in this >> e-mail is strictly forbidden >> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte >> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail >> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und >> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte >> Weitergabe dieser Mail sind nicht gestattet. >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/be415354-c3df-4e6b-b77a-4727b37d91e2%40googlegroups.com.
