I've been trying since a while to add and modify things within jenkins. Jenkins was running on 8080 port, I redirected trafic to 80 port through this command:
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 54.185.x.x:8080
I did some modifications and now I cannot start jenkins:
Jun 08 13:20:17 ip-10-173-x-x jenkins[32108]: Correct java version found
Jun 08 13:20:17 ip-10-173-x-x jenkins[32108]: * Starting Jenkins Automation Server jenkins
Jun 08 13:20:17 ip-10-173-x-x su[32157]: Successful su for jenkins by root
Jun 08 13:20:17 ip-10-173-x-x su[32157]: + ??? root:jenkins
Jun 08 13:20:17 ip-10-173-x-x su[32157]: pam_unix(su:session): session opened for user jenkins by (uid=0)
Jun 08 13:20:17 ip-10-173-x-x su[32157]: pam_unix(su:session): session closed for user jenkins
Jun 08 13:20:18 ip-10-173-x-x jenkins[32108]: ...fail!
Jun 08 13:20:18 ip-10-173-x-x systemd[1]: jenkins.service: Control process exited, code=exited status=7
Jun 08 13:20:18 ip-10-173-x-x systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jun 08 13:20:18 ip-10-173-x-x systemd[1]: Failed to start LSB: Start Jenkins at boot time.
I changed few lines in the jenkins file and here how it looks like:
JENKINS_ARGS="--javahome=$JAVA_HOME --httpListenAddress=$HTTP_HOST --httpPort=$HTTP_PORT --webroot=~/.jenkins/war"
Related
Ubuntu 20.04 LTS
I just installed oss version if JFrog Artifactory
To run artifactory I used systemctl start artifactory.service by getting this error:
Job for artifactory.service failed because the control process exited with error code.
See "systemctl status artifactory.service" and "journalctl -xe" for details.
If I run systemctl status artifactory.service this is what I am getting
● artifactory.service - Artifactory service
Loaded: loaded (/lib/systemd/system/artifactory.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Jun 01 00:25:42 siddharth-HP-Notebook systemd[1]: Stopped Artifactory service.
Jun 01 00:25:42 siddharth-HP-Notebook systemd[1]: Starting Artifactory service...
Jun 01 00:25:43 siddharth-HP-Notebook artifactoryManage.sh[17274]: 2020-05-31T18:55:43.286Z [shell] [INFO ] [] [artifac>
Jun 01 00:25:43 siddharth-HP-Notebook systemd[1]: artifactory.service: Can't open PID file /run/artifactory.pid (yet?) >
Jun 01 00:25:43 siddharth-HP-Notebook systemd[1]: artifactory.service: Failed with result 'protocol'.
Jun 01 00:25:43 siddharth-HP-Notebook systemd[1]: Failed to start Artifactory service.
Jun 01 00:25:48 siddharth-HP-Notebook systemd[1]: Stopped Artifactory service.
Jun 01 00:25:48 siddharth-HP-Notebook systemd[1]: /lib/systemd/system/artifactory.service:10: PIDFile= references a pat>
Jun 01 00:31:37 siddharth-HP-Notebook systemd[1]: /lib/systemd/system/artifactory.service:10: PIDFile= references a pat>
Jun 01 00:31:38 siddharth-HP-Notebook systemd[1]: /lib/systemd/system/artifactory.service:10: PIDFile= references a pat>
Also during the installation, I got this error in the end that can be helpful:
Triggering migration script, this will migrate if needed ...
chown: invalid user: ‘artifactory:artifactory’
[WARN] Could not set owner of [/opt/jfrog/artifactory/var/etc] to [artifactory:artifactory]
Processing triggers for systemd (245.4-4ubuntu3.1) ...
Be sure that PID file is there:
Jun 01 00:25:43 siddharth-HP-Notebook systemd[1]: artifactory.service: Can't open PID file /run/artifactory.pid (yet?) >
If it's there, you need to check permissions and your service file to check what's your path of PID file
We have installed docker 17.12 in our Centos 7.x and after the installation is complete, am facing an error while trying to start the docker service. Initially, I tried for systemctl docker start then for more output on this when I tried journalctl it says docker.service entered failed state.
More details below:
Docker :
17.12.1-ce , build 7390fc6
Command tried:
sudo systemctl start docker
journalctl -u docker.service
Expected Output:
Docker service should be started successfully
Actual output:
Mar 26 23:51:19 docker[16420]: See 'docker --help'
Mar 26 23:51:19 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 26 23:51:19 systemd[1]: Failed to start Docker Application Container Engine.
Mar 26 23:51:19 systemd[1]: Unit docker.service entered failed state.
Mar 26 23:51:19 docker.service failed.
Mar 26 23:51:21 systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 26 23:51:21 systemd[1]: start request repeated too quickly for docker.service
Mar 26 23:51:21 systemd[1]: Failed to start Docker Application Container Engine.
Mar 26 23:51:21 systemd[1]: Unit docker.service entered failed state.
Mar 26 23:51:21 systemd[1]: docker.service failed.
Mar 26 23:52:22 systemd[1]: Starting Docker Application Container Engine...
Mar 26 23:52:22 docker[16582]: docker: 'daemon' is not a docker command.
Mar 26 23:52:22 docker[16582]: See 'docker --help'
Mar 26 23:52:22 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 26 23:52:22 systemd[1]: Failed to start Docker Application Container Engine.
Mar 26 23:52:22 systemd[1]: Unit docker.service entered failed state.
Mar 26 23:52:22 systemd[1]: docker.service failed.
Mar 26 23:52:24 systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 26 23:52:24 systemd[1]: Starting Docker Application Container Engine...
Mar 26 23:52:25 docker[16601]: docker: 'daemon' is not a docker command.
Mar 26 23:52:25 docker[16601]: See 'docker --help'
Mar 26 23:52:25 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 26 23:52:25 systemd[1]: Failed to start Docker Application Container Engine.
Mar 26 23:52:25 systemd[1]: Unit docker.service entered failed state.
Mar 26 23:52:25 systemd[1]: docker.service failed.
Mar 26 23:52:27 systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 26 23:52:27 systemd[1]: Starting Docker Application Container Engine...
Mar 26 23:52:27 docker[16619]: docker: 'daemon' is not a docker command.
Mar 26 23:52:27 docker[16619]: See 'docker --help'
Mar 26 23:52:27 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 26 23:52:27 systemd[1]: Failed to start Docker Application Container Engine.
Mar 26 23:52:27 systemd[1]: Unit docker.service entered failed state.
Mar 26 23:52:27 systemd[1]: docker.service failed.
Mar 26 23:52:29 systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 26 23:52:29 systemd[1]: start request repeated too quickly for docker.service
Mar 26 23:52:29 systemd[1]: Failed to start Docker Application Container Engine.
Mar 26 23:52:29 systemd[1]: Unit docker.service entered failed state.
Mar 26 23:52:29 systemd[1]: docker.service failed.
Please check on this issue and help us resolve the docker start issue.
no evidence in your log.
Would you just reinstall with the official way ?
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sh get-docker.sh
Check if there's another issue with:
sudo dockerd --debug
In my situation I had invalid config in the daemon.json.
I'm trying run docker in Ubuntu 16.04 after system reboot . I created service for it "/etc/systemd/system/openvpnBOX.service":
[Unit]
Description=Openvpn Docker
[Service]
User=root
ExecStart=/etc/init/openvpn.conf
[Install]
WantedBy=multi-user.target
Alias=openvpnBOX.service
openvpn.conf:
#!/bin/bash
exec docker run --volumes-from ovpn-data --rm -p 1194:1194/udp --cap- add=NET_ADMIN kylemanna/openvpn
When i'm running this service "sudo service openvpnBOX start i see that service is run, but when i'm rebooting my system, after reboot i see that service can't start:
"sudo service openvpnBOX status"
● openvpnBOX.service - Openvpn Docker
Loaded: loaded (/etc/systemd/system/openvpnBOX.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-10-01 21:35:48 SST; 2min 51s ago
Process: 1771 ExecStart=/etc/init/openvpn.conf (code=exited, status=1/FAILURE)
Main PID: 1771 (code=exited, status=1/FAILURE)
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Main process exited, code=exited, status=1/FAILURE
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Unit entered failed state.
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Failed with result 'exit-code'.
Oct 01 21:35:48 systemd[1]: Started Openvpn Docker.
Oct 01 21:35:48 openvpn.conf[1771]: Error response from daemon: 404 page not found
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Main process exited, code=exited, status=1/FAILURE
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Unit entered failed state.
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Failed with result 'exit-code'.
Oct 01 21:35:48 systemd[1]: openvpnBOX.service: Start request repeated too quickly.
Oct 01 21:35:48 systemd[1]: Failed to start Openvpn Docker.
I can use "sudo docker run --restart=always --volumes-from ovpn-data -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn" but it doesn't solve my problem, because i woud like understand why my service doesn't work after reboot.
Any idea?
I am trying to deploy my new rails app to Ubuntu 16.04 Digital Ocean Server. Here Unicorn is managed via systemd. This is my /etc/systemd/system/unicorn.service file
[Unit]
Description=Skreem Application
Before=nginx.service
Requires=network.target
[Service]
Type=simple
User=rails
Group=rails
RuntimeDirectory=DigitalOceanOneClick
SyslogIdentifier=DigitalOceanRailsOneClick
# Go paranoid
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
ProtectKernelTunables=true
NoNewPrivileges=true
WorkingDirectory=/home/rails/skreem-ror
ExecStart=/bin/bash /home/rails/skreem-ror/.unicorn.sh
TimeoutSec=60s
RestartSec=10s
Restart=always
[Install]
WantedBy=multi-user.target
When I am trying to restart the unicorn service, I am getting following error
Failed to restart unicorn.service: Unit unicorn.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status unicorn.service' for details.
Then I tried systemctl status unicorn.service and getting
Jul 03 10:05:06 skreem-dev2 systemd[1]: unicorn.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 10:05:06 skreem-dev2 systemd[1]: unicorn.service: Unit entered failed state.
Jul 03 10:05:06 skreem-dev2 systemd[1]: unicorn.service: Failed with result 'exit-code'.
Jul 03 10:05:07 skreem-dev2 systemd[1]: [/etc/systemd/system/unicorn.service:18] Unknown lvalue 'ProtectKernelTunables' in section 'Service'
Jul 03 10:05:07 skreem-dev2 systemd[1]: [/etc/systemd/system/unicorn.service:32] Missing '='.
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Service hold-off time over, scheduling restart.
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Failed to schedule restart job: Unit unicorn.service is not loaded properly: Invalid a
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Unit entered failed state.
Jul 03 10:05:16 skreem-dev2 systemd[1]: unicorn.service: Failed with result 'resources'.
Jul 03 11:33:51 skreem-dev2 systemd[1]: Stopped DigitalOcean Rails One-Click Application.
Its not coming from my updated unicorn.service file. Is it because my changes are not loading properly. Please help me to solve this issue.
I have installed and configured jenkins on the centos 7.I have added valid java path i.e "/usr/bin/java" in the file /etc/init.d/jenkins.
Below are the java path detils:
lrwxrwxrwx. 1 root root 22 Dec 24 2015 java -> /etc/alternatives/java
Now, on running "service jenkins start" command from root user, I am getting below error.
● jenkins.service - LSB: Jenkins Continuous Integration Server
Loaded: loaded (/etc/rc.d/init.d/jenkins)
Active: failed (Result: exit-code) since Wed 2016-07-13 18:25:51 IST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 807 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=1/FAILURE)
Jul 13 18:25:51 localhost systemd[1]: Starting LSB: Jenkins Continuous Integration Server...
Jul 13 18:25:51 localhost runuser[812]: pam_unix(runuser:session): session opened for user jenkins by (uid=0)
Jul 13 18:25:51 localhost jenkins[807]: Starting Jenkins bash: /usr/bin/java: Permission denied
Jul 13 18:25:51 localhost runuser[812]: pam_unix(runuser:session): session closed for user jenkins
Jul 13 18:25:51 localhost jenkins[807]: [FAILED]
Jul 13 18:25:51 localhost systemd[1]: jenkins.service: control process exited, code=exited status=1
Jul 13 18:25:51 localhost systemd[1]: Failed to start LSB: Jenkins Continuous Integration Server.
Jul 13 18:25:51 localhost systemd[1]: Unit jenkins.service entered failed state.
Jul 13 18:25:51 localhost systemd[1]: jenkins.service failed.
I am not able to figure out why it's giving me permission denied even though every user having access to the java path.
also on running "journalctl -xe" command it shows below log:
Jul 13 18:45:33 localhost systemd[1]: Unit jenkins.service entered failed state.
Jul 13 18:45:33 localhost systemd[1]: jenkins.service failed.
Jul 13 18:45:33 localhost polkitd[20151]: Unregistered Authentication Agent for unix-process:27889:3161602 (system bus name :1.303, object path /org/freedesktop/PolicyKit1/AuthenticationAgen
Is it like that the Jenkins service does't having permission to access the java path? if not why it's giving that error?
You have two options to solve the problem.
Jenkins service is started by jenkins user. The error says that jenkins user does not have permission to run java. So check orginal java path and give execute permissions to other users.
In jenkins.service unit file, change the owner of the service. Replace User=jenkins with User=root
The default user of service jenkins is "jenkins". So "jenkins" may not have the pemission to access service "java".
So we need to change the use of service jenkins.
From the jenkins service boost script "/etc/init.d/jenkins". We can get the config file path, such as "/etc/sysconfig/jenkins"
Try changing the file, /etc/init.d/jenkins
Specifically look for the JENKINS_USER key and try replacing jenkins with root.
This worked for me on RHEL.