Hello,
Please can somebody help me?, I need to create a init script in centos 7, I’m installed from sources, my path is:
/home/xymon/client/runclient.sh
I create a systemctl script with this (/etc/systemd/system/xymond.service):
xymond.service
systemd file for Fedora 18 and up, or RHEL 7 and up
[Unit] Description=Xymon is the service for monitoring system Documentation=man:xymon(7) man:xymonlaunch(8) man:xymon(1) After=network.target
[Install]
Compatibility with "xymon" and "xymon-client"
#Alias=xymond.service WantedBy=multi-user.target
[Service] #EnvironmentFile=/etc/sysconfig/xymonlaunch User=xymon
We wrap in xymoncmd to eliminate the need for the bulk of the old init script
ExecStart=/home/xymon/client/runclient.sh #ExecStop=/home/xymon/client/runclient.sh stop Type=simple
Kill xymonlaunch, but don't send kills to the underlying procs, since they
might be doing important things (like writing checkpoints and flushing caches)
KillMode=process
SendSIGHUP=yes
SendSIGKILL=no
But not start:
xymond.service - Xymon is the service that work with the Corpresa monitoring system Loaded: loaded (/etc/systemd/system/xymond.service; enabled; vendor preset: disabled) Active: inactive (dead) since mar 2016-09-20 17:15:39 EDT; 1min 3s ago Docs: man:xymon(7) man:xymonlaunch(8) man:xymon(1) Process: 12573 ExecStart=/home/xymon/client/runclient.sh (code=exited, status=0/SUCCESS) Main PID: 12573 (code=exited, status=0/SUCCESS) CGroup: /system.slice/xymond.service ├─12410 sh -c vmstat 300 2 1>/home/xymon/client/tmp/xymon_vmstat.live-sync.arroyof.com.12374 2>&1; mv /home/xymon/client/tmp/xymon_vmstat.live-sync.arroyof.com.12374 /home/xymon/client/tmp/xymon_vmstat.live-sync.... ├─12412 vmstat 300 2 ├─12502 sh -c vmstat 300 2 1>/home/xymon/client/tmp/xymon_vmstat.live-sync.arroyof.com.12470 2>&1; mv /home/xymon/client/tmp/xymon_vmstat.live-sync.arroyof.com.12470 /home/xymon/client/tmp/xymon_vmstat.live-sync.... └─12504 vmstat 300 2 ———————————————————————————————————————————————
Thank you, best regards