I have been attempting to get systemd running as my USERID via the --user parameter to systemctl. The objective is to convert my personal crontab to systemd.
So far it has been a failure. Searching online, I have found and read numerous posts without success. I am trying to get a simple script running on a calendar basis to provide a base for further development. I hope sharing my experience will get me pointed in the right direction.
SCRIPT RAUhellouser (in USERID/.local/share/systemd/user/)
#!/bin/bash
PRGNAM=$(basename -- "$0")
echo "$PRGNAM - $(date) - Hello User - $(id -nu)" >> /tmp/RAUhello_user.log
00echolines >> /tmp/RAUhello_user.log # A USER/bin script that produces eye-catcher boundaries
echo "$PRGNAM - PATH - $PATH " >> /tmp/RAUhello_user.log
echo "$PRGNAM - Current Working Directory: $(pwd)" >> /tmp/RAUhello_user.log
exit 0
=================================================
SERVICE RAUhellouser.service (in USERID/.config/systemd/user/)
[Unit]
Description="Hello User Service"
[Service]
Type=oneshot
ExecStart=RAUhellouser
[Install]
WantedBy=default.target
=================================================
TIMER RAUhellouser.timer (in USERID/.config/systemd/user/)
[Unit]
Description=Run Hello User Script
[Timer]
OnCalendar=*-*-* *:*:00
[Install]
WantedBy=basic.target
=================================================
CURRENT STATUS
USERID@localhost.heavy1] ~ $ systemctl --user daemon-reload
USERID@localhost.heavy1] ~ $ systemctl --user start RAUhellouser.timer
USERID@localhost.heavy1] ~ $ systemctl --user status RAUhellouser.timer
β RAUhellouser.timer - Run Hello User Script
Loaded: loaded (/home/USERID/.config/systemd/user/RAUhellouser.timer; disabled; preset: disabled)
Active: active (waiting) since Fri 2025-05-09 16:24:51 MST; 21s ago
Trigger: Fri 2025-05-09 16:26:00 MST; 46s left
Triggers: β RAUhellouser.service
May 09 16:24:51 localhost.heavy1 systemd[19430]: Started Run Hello User Script.
USERID@localhost.heavy1] ~ $ systemctl --user status RAUhellouser.service
Γ RAUhellouser.service - "Hello User Service"
Loaded: loaded (/home/USERID/.config/systemd/user/RAUhellouser.service; disabled; preset: disabled)
Active: failed (Result: exit-code) since Fri 2025-05-09 16:27:08 MST; 512ms ago
Duration: 2ms
TriggeredBy: β RAUhellouser.timer
Process: 11295 ExecStart=RAUhellouser (code=exited, status=203/EXEC)
Main PID: 11295 (code=exited, status=203/EXEC)
CPU: 2ms
May 09 16:27:08 localhost.heavy1 systemd[19430]: Starting "Hello User Service"...
May 09 16:27:08 localhost.heavy1 (ellouser)[11295]: RAUhellouser.service: Failed to locate executable RAUhellouser: No such file or directory
May 09 16:27:08 localhost.heavy1 (ellouser)[11295]: RAUhellouser.service: Failed at step EXEC spawning RAUhellouser: No such file or directory
May 09 16:27:08 localhost.heavy1 systemd[19430]: RAUhellouser.service: Main process exited, code=exited, status=203/EXEC
May 09 16:27:08 localhost.heavy1 systemd[19430]: RAUhellouser.service: Failed with result 'exit-code'.
May 09 16:27:08 localhost.heavy1 systemd[19430]: Failed to start "Hello User Service".
USERID@localhost.heavy1] ~ $
=================================================
JOURNAL EXTRACT
journalctl --output=short-full --since 16:27:00 -xe --user --unit=RAUhellouser*
Fri 2025-05-09 16:27:08 MST localhost.heavy1 systemd[19430]: Starting "Hello User Service"...
ββ Subject: A start job for unit UNIT has begun execution
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ A start job for unit UNIT has begun execution.
ββ
ββ The job identifier is 631387.
Fri 2025-05-09 16:27:08 MST localhost.heavy1 (ellouser)[11295]: RAUhellouser.service: Failed to locate executable RAUhellouser: No such file or directory
ββ Subject: Process RAUhellouser could not be executed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ The process RAUhellouser could not be executed and failed.
ββ
ββ The error number returned by this process is 2.
Fri 2025-05-09 16:27:08 MST localhost.heavy1 (ellouser)[11295]: RAUhellouser.service: Failed at step EXEC spawning RAUhellouser: No such file or directory
ββ Subject: Process RAUhellouser could not be executed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ The process RAUhellouser could not be executed and failed.
ββ
ββ The error number returned by this process is 2.
Fri 2025-05-09 16:27:08 MST localhost.heavy1 systemd[19430]: RAUhellouser.service: Main process exited, code=exited, status=203/EXEC
ββ Subject: Unit process exited
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ An ExecStart= process belonging to unit UNIT has exited.
ββ
ββ The process' exit code is 'exited' and its exit status is 203.
Fri 2025-05-09 16:27:08 MST localhost.heavy1 systemd[19430]: RAUhellouser.service: Failed with result 'exit-code'.
ββ Subject: Unit failed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ The unit UNIT has entered the 'failed' state with result 'exit-code'.
Fri 2025-05-09 16:27:08 MST localhost.heavy1 systemd[19430]: Failed to start "Hello User Service".
ββ Subject: A start job for unit UNIT has failed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ A start job for unit UNIT has finished with a failure.
ββ
ββ The job identifier is 631387 and the job result is failed.
================Redacted===================
ββ The job identifier is 633555 and the job result is failed.
Fri 2025-05-09 16:51:03 MST localhost.heavy1 systemd[19430]: Starting "Hello User Service"...
ββ Subject: A start job for unit UNIT has begun execution
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ A start job for unit UNIT has begun execution.
ββ
ββ The job identifier is 633651.
Fri 2025-05-09 16:51:03 MST localhost.heavy1 (ellouser)[12277]: RAUhellouser.service: Failed to locate executable RAUhellouser: No such file or directory
ββ Subject: Process RAUhellouser could not be executed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ The process RAUhellouser could not be executed and failed.
ββ
ββ The error number returned by this process is 2.
Fri 2025-05-09 16:51:03 MST localhost.heavy1 (ellouser)[12277]: RAUhellouser.service: Failed at step EXEC spawning RAUhellouser: No such file or directory
ββ Subject: Process RAUhellouser could not be executed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ The process RAUhellouser could not be executed and failed.
ββ
ββ The error number returned by this process is 2.
Fri 2025-05-09 16:51:03 MST localhost.heavy1 systemd[19430]: RAUhellouser.service: Main process exited, code=exited, status=203/EXEC
ββ Subject: Unit process exited
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ An ExecStart= process belonging to unit UNIT has exited.
ββ
ββ The process' exit code is 'exited' and its exit status is 203.
Fri 2025-05-09 16:51:03 MST localhost.heavy1 systemd[19430]: RAUhellouser.service: Failed with result 'exit-code'.
ββ Subject: Unit failed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ The unit UNIT has entered the 'failed' state with result 'exit-code'.
Fri 2025-05-09 16:51:03 MST localhost.heavy1 systemd[19430]: Failed to start "Hello User Service".
ββ Subject: A start job for unit UNIT has failed
ββ Defined-By: systemd
ββ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
ββ
ββ A start job for unit UNIT has finished with a failure.
ββ
ββ The job identifier is 633651 and the job result is failed.
=================================================