Using Ubuntu 22.04.4 LTS, I have this unit file:
#Installed in the global system
#
# /lib/systemd/system/flm.service
# systemctl daemon-reload
# systemctl stop flm.service
# systemctl start flm.service
# systemctl status flm.service
#
# Installed in user space
#
# ~/.config/systemd/user/flm.service
#
# systemctl --user daemon-reload
# systemctl --user stop flm.service
# systemctl --user start flm.service
# systemctl --user status flm.service
[Unit]
Description=FourJs License Manager 6.00.13-202303241116
After=network.target nss-lookup.target
Documentation=https://4js.com/online_documentation/fjs-flm-manual-html
[Service]
Type=exec
Environment="FLMDIR=/tmp/flm"
ExecStartPre=/tmp/flm/bin/flmprg -a env
ExecStart=/tmp/flm/bin/flmprg -D
ExecReload=/tmp/flm/bin/flmprg --service-restart
ExecStop=/tmp/flm/bin/flmprg --service-stop
KillMode=mixed
Restart=on-abort
SuccessExitStatus=SIGTERM 0
PrivateTmp=true
[Install]
WantedBy=multi-user.target
When I try to start the service, I get:
ubuntu@ip-172-30-2-235:/tmp/flm/bin$ systemctl status flm.service
× flm.service - FourJs License Manager 6.00.13-202303241116
Loaded: loaded (/lib/systemd/system/flm.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-08-07 01:35:16 UTC; 6s ago
Docs: https://4js.com/online_documentation/fjs-flm-manual-html
Process: 15296 ExecStartPre=/tmp/flm/bin/flmprg -a env (code=exited, status=203/EXEC)
CPU: 3ms
Aug 07 01:35:16 ip-172-30-2-235 systemd[1]: Starting FourJs License Manager 6.00.13-202303241116...
Aug 07 01:35:16 ip-172-30-2-235 systemd[15296]: flm.service: Failed to locate executable /tmp/flm/bin/flmprg: No such file or directory
Aug 07 01:35:16 ip-172-30-2-235 systemd[15296]: flm.service: Failed at step EXEC spawning /tmp/flm/bin/flmprg: No such file or directory
Aug 07 01:35:16 ip-172-30-2-235 systemd[1]: flm.service: Control process exited, code=exited, status=203/EXEC
Aug 07 01:35:16 ip-172-30-2-235 systemd[1]: flm.service: Failed with result 'exit-code'.
Aug 07 01:35:16 ip-172-30-2-235 systemd[1]: Failed to start FourJs License Manager 6.00.13-202303241116.
However, the file is definitely there and executable, as if I cut and past the path from the error message and take on the switches from the unit file, I can run it as user ubuntu from the command line:
ubuntu@ip-172-30-2-235:/tmp/flm/bin$ /tmp/flm/bin/flmprg -a env
Hostname: ip-172-30-2-235
FLM server: localhost
FLM service: 6811
FLM pidfile: /tmp/flm/pidfile
Log directory: /tmp/flm
Log categories: error,warning,info
Log enabled: false
Log max files: 0
Client ping interval: 30
Permissions of the directories involved:
drwxrwxrwt 12 root root 4096 Aug 7 02:04 tmp
drwxrwxrwx 10 ubuntu ubuntu 4096 Aug 7 01:54 flm
drwxrwxrwx 2 ubuntu ubuntu 4096 May 17 17:08 bin
-rwxrwxrwx 1 ubuntu ubuntu 472848 May 17 17:08 flmprg
If anyone has any ideas where I’m going wrong with this, it would be much appreciated.