Trying to create an service for wily when the server shutdowns or starts.
Getting some errors and I would like to know what I am doing wrong.
my service
[Unit]
Description= Wily
After=systemd-user-sessions.service multi-user.target network.target nscd.service sssd.service
[Service]
Type=forking
RemainAfterExit=no
ExecStart=sudo -u isadm /bin/sh -c "/opt/Wily/Introscope/bin/EMCtrl.sh start"
ExecStop=sudo -u isadm /bin/sh -c "/opt/Wily/Introscope/bin/EMCtrl.sh stop"
[Install]
WantedBy=multi-user.target
error when I am doing systemctl status wily
● wily.service - Wily
Loaded: error (Reason: Invalid argument)
Active: failed (Result: exit-code) since Wed 2022-04-06 08:01:17 EDT; 4min 28s ago
Main PID: 18007 (code=exited, status=127)
acpic-s2042 systemd[1]: wily.service: Main process exited, code=exited, status=127/n/a
acpic-s2042 systemd[1]: wily.service: Unit entered failed state.
acpic-s2042 systemd[1]: wily.service: Failed with result 'exit-code'.
acpic-s2042 systemd[1]: Stopped Wily.
acpic-s2042 systemd[1]: [/etc/systemd/system/wily.service:11] Executable path is not absolute, ignoring: sudo -u isadm -c "/opt/Wily/Introsco...l.sh start"
acpic-s2042 systemd[1]: [/etc/systemd/system/wily.service:14] Executable path is not absolute, ignoring: sudo -u isadm -c "/opt/Wily/Introsco...rl.sh stop"
acpic-s2042 systemd[1]: wily.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
acpic-s2042 systemd[1]: [/etc/systemd/system/wily.service:11] Executable path is not absolute, ignoring: sudo -u isadm /bin/sh -c "/opt/Wily/...l.sh start"
acpic-s2042 systemd[1]: [/etc/systemd/system/wily.service:14] Executable path is not absolute, ignoring: sudo -u isadm /bin/sh -c "/opt/Wily/...rl.sh stop"
acpic-s2042 systemd[1]: wily.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Release : 10.7.0
Component :
As this is a Linux issue, the best way is to google the error "Executable path is not absolute, ignoring."
I did find quite a lot of hits, notably this one which states that all commands must have an absolute path.
https://stackoverflow.com/questions/48684468/executable-path-is-not-absolute-ignoring-which-node
systemd will not accept commands that are not given with absolute path, so to accomplish what you want you need rely on bash
Since this is involving OS and OS customizations, Communities and Google would be the best areas on getting the service to start via boot. Please keep in mind, you need proper permissions for the service to invoke <EM Home>/bin/EMCtrl.sh. When attempting to start the EM (or stop) from another path, you need to execute the script using ./ as below
/opt/Introscope/bin/./EMCtrl.sh start
/opt/Introscope/bin/./EMCtrl.sh stop