Re: (SOLVED) Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread gianpaolo


On Friday, November 8, 2019 at 4:01:28 PM UTC+1, Dirk Heinrichs wrote:
>
> Am Freitag, den 08.11.2019, 06:53 -0800 schrieb gianpaolo:
>
> 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
>
>
> Strange. I am running Jenkins on several Debian and Ubuntu machines and 
> have never seen such behaviour.
>
> BTW: You should not modify the service file provided by the package. It's 
> better to create an overlay file 
> (/etc/systemd/system/jenkins.service.d/local.conf) which contains your 
> modifications to avoid having them removed when the package is updated.
>
> Bye...
>
>  
Thank you very much! I didn't know about the overlay file. 

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/08cf9397-b76f-4696-87e2-02b251e17171%40googlegroups.com.


Re: (SOLVED) Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread Dirk Heinrichs
Am Freitag, den 08.11.2019, 06:53 -0800 schrieb gianpaolo:

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

Strange. I am running Jenkins on several Debian and Ubuntu machines and have 
never seen such behaviour.

BTW: You should not modify the service file provided by the package. It's 
better to create an overlay file 
(/etc/systemd/system/jenkins.service.d/local.conf) which contains your 
modifications to avoid having them removed when the package is updated.

Bye...

Dirk

--

Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f9268a75c46bf68615dc69f7cf734ce895986a49.camel%40opentext.com.


(SOLVED) Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread gianpaolo
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 

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*: dhei...@opentext.com
>> *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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/be415354-c3df-4e6b-b77a-4727b37d91e2%40googlegroups.com.


Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread gianpaolo
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*: dhei...@opentext.com 
> *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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b27a98ee-2f6f-4330-bfcd-73be780b6689%40googlegroups.com.


Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread Dirk Heinrichs
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: dhein...@opentext.com
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/11791bfc0af9d94ee16c86ef74b3e7ad0f6c21c1.camel%40opentext.com.


Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread gianpaolo
ok
the only thing that I miss now is why at every reboot I have to run

sudo service jenkins start 

the service is enabled, why does it need to be manually run every time?

On Friday, November 8, 2019 at 2:34:50 PM UTC+1, gianpaolo wrote:
>
> Hi
> it's a nightmare. I've tried all the possible solutions and reinstalled 
> everything.
>
> Is there a complete ubuntu instruction?
> i have followed this:
> https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu
>
> Still, after the first reboot, I'm again not able to get it running. 
>
> On Friday, November 8, 2019 at 1:47:39 PM UTC+1, ravi krishna wrote:
>>
>> Hello Gianaolo,
>>
>> Hope you logged in with root user or Jenkins user must have sudo 
>> permissions. 
>>
>> On Fri, Nov 8, 2019 at 5:55 PM gianpaolo  wrote:
>>
>>> Hello
>>> I've installed and run Jenkins successfully, but at the first reboot I 
>>> coudnt get it up again.
>>> I have the journal log:
>>>
>>>  systemd[1]: Starting Jenkins - open source automation server...
>>> jenkins[3540]: Correct java version found
>>> jenkins[3540]:  * Starting Jenkins Automation Server jenkins
>>> 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!
>>> ci systemd[1]: jenkins.service: Main process exited, code=exited,   
>>> status=7/NOTRUNNING
>>> systemd[1]: jenkins.service: Failed with result 'exit-code'.
>>> systemd[1]: Failed to start Jenkins - open source automation server.
>>>
>>> I posted the question also on superuser 
>>> 
>>>
>>>
>>>
>>> Can you help me? 
>>>
>>> Thanks
>>> Gianpaolo
>>>
>>> -- 
>>> 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 jenkins...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/5f886501-5849-45d5-873e-650c5102ce9b%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Ravi Krishna D 
>> http://sahaaya4needy.org
>> http://sahaaya.onsugar.com
>>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e4d09846-92ab-4904-a899-c478cc863ae8%40googlegroups.com.


Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread gianpaolo
Hi
it's a nightmare. I've tried all the possible solutions and reinstalled 
everything.

Is there a complete ubuntu instruction?
i have followed this:
https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu

Still, after the first reboot, I'm again not able to get it running. 

On Friday, November 8, 2019 at 1:47:39 PM UTC+1, ravi krishna wrote:
>
> Hello Gianaolo,
>
> Hope you logged in with root user or Jenkins user must have sudo 
> permissions. 
>
> On Fri, Nov 8, 2019 at 5:55 PM gianpaolo > 
> wrote:
>
>> Hello
>> I've installed and run Jenkins successfully, but at the first reboot I 
>> coudnt get it up again.
>> I have the journal log:
>>
>>  systemd[1]: Starting Jenkins - open source automation server...
>> jenkins[3540]: Correct java version found
>> jenkins[3540]:  * Starting Jenkins Automation Server jenkins
>> 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!
>> ci systemd[1]: jenkins.service: Main process exited, code=exited,   
>> status=7/NOTRUNNING
>> systemd[1]: jenkins.service: Failed with result 'exit-code'.
>> systemd[1]: Failed to start Jenkins - open source automation server.
>>
>> I posted the question also on superuser 
>> 
>>
>>
>>
>> Can you help me? 
>>
>> Thanks
>> Gianpaolo
>>
>> -- 
>> 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 jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/5f886501-5849-45d5-873e-650c5102ce9b%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Ravi Krishna D 
> http://sahaaya4needy.org
> http://sahaaya.onsugar.com
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/87accf4f-3ba5-4811-9565-fcc23f5e9b4e%40googlegroups.com.


Re: Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread ravi krishna
Hello Gianaolo,

Hope you logged in with root user or Jenkins user must have sudo
permissions.

On Fri, Nov 8, 2019 at 5:55 PM gianpaolo  wrote:

> Hello
> I've installed and run Jenkins successfully, but at the first reboot I
> coudnt get it up again.
> I have the journal log:
>
>  systemd[1]: Starting Jenkins - open source automation server...
> jenkins[3540]: Correct java version found
> jenkins[3540]:  * Starting Jenkins Automation Server jenkins
> 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!
> ci systemd[1]: jenkins.service: Main process exited, code=exited,   
> status=7/NOTRUNNING
> systemd[1]: jenkins.service: Failed with result 'exit-code'.
> systemd[1]: Failed to start Jenkins - open source automation server.
>
> I posted the question also on superuser 
> 
>
>
>
> Can you help me?
>
> Thanks
> Gianpaolo
>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/5f886501-5849-45d5-873e-650c5102ce9b%40googlegroups.com
> 
> .
>


-- 
Ravi Krishna D
http://sahaaya4needy.org
http://sahaaya.onsugar.com

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAKS7Qv0yTRHQU2Mb4f3%3DqH8p_qxtLeCVKLdB3TQHzvyLcUfw-w%40mail.gmail.com.


Problem running Jenkins as a system service on Ubuntu

2019-11-08 Thread gianpaolo
Hello
I've installed and run Jenkins successfully, but at the first reboot I 
coudnt get it up again.
I have the journal log:

 systemd[1]: Starting Jenkins - open source automation server...
jenkins[3540]: Correct java version found
jenkins[3540]:  * Starting Jenkins Automation Server jenkins
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!
ci systemd[1]: jenkins.service: Main process exited, code=exited,   
status=7/NOTRUNNING
systemd[1]: jenkins.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Jenkins - open source automation server.

I posted the question also on superuser 




Can you help me? 

Thanks
Gianpaolo

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5f886501-5849-45d5-873e-650c5102ce9b%40googlegroups.com.