Skip to content

Commit a20c359

Browse files
Update service-status
1 parent b3c925a commit a20c359

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

service-status

+35
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,41 @@ done
6464

6565
#END
6666

67+
For Centos 7
68+
https://www.writebash.com/advanced-tutorial/make-bash-script-run-as-a-service-in-centos-7-259.html
6769

6870

71+
[Unit]
72+
Description=Getload service - WriteBash demo service in CentOS 7.x
73+
After=network.target
74+
75+
[Service]
76+
Type=simple
77+
PIDFile=/var/run/getload.pid
78+
ExecStart=/bin/sh -c "/opt/getload.sh >>/var/log/getload.log 2>&1"
79+
TimeoutStartSec=0
80+
Restart=on-failure
81+
82+
[Install]
83+
WantedBy=default.target
84+
85+
86+
########################
87+
88+
jira example
89+
90+
[Unit]
91+
Description=Jira Service By Muhammad Asim
92+
After=network.target
93+
StartLimitIntervalSec=0
94+
95+
[Service]
96+
Type=simple
97+
PIDFile=/var/run/getload.pid
98+
ExecStart=/bin/sh -c "/root/bash/while.sh"
99+
TimeoutStartSec=0
100+
Restart=on-failure
101+
102+
[Install]
103+
WantedBy=multi-user.target
69104

0 commit comments

Comments
 (0)