I have created below script in RHEL 7.6, but unfortunately getting EXEC format error.
When i execute the command from working directory it's working fine.
below is the service file which was created at /etc/systemd/system/zauto.service
vi /etc/systemd/system/zauto.service
[unit]
Description=ZAuto service
After=default.target
[Service]
Type=simple
ExecStart=/home/ims/setup/zauto/ZAuto.sh
WorkingDirectory=/home/ims/setup/zauto
Restart=on-abort
[Install]
WantedBy=multi-user.target
systemctl status zauto.service -l
[root@ApplicationServer ims]# systemctl status zauto.service -l
● zauto.service
Loaded: loaded (/etc/systemd/system/zauto.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2020-02-27 16:10:41 IST; 23min ago
Process: 1862 ExecStart=/home/ims/setup/zauto/ZAuto.sh (code=exited, status=203/EXEC)
Main PID: 1862 (code=exited, status=203/EXEC)
Feb 27 16:10:41 localhost.localdomain systemd[1]: Started zauto.service.
Feb 27 16:10:41 localhost.localdomain systemd[1]: zauto.service: main process exited, code=exited, status=203/EXEC
Feb 27 16:10:41 localhost.localdomain systemd[1]: Unit zauto.service entered failed state.
Feb 27 16:10:41 localhost.localdomain systemd[1]: zauto.service failed.
Please help me to resolve the issue.