Sujet : Re: Systemd ... Pass CL Params to Pgm ?
De : c186282 (at) *nospam* nnada.net (c186282)
Groupes : comp.os.linux.miscDate : 12. Jun 2025, 20:04:33
Autres entêtes
Message-ID : <jLacnTMgQdUhudb1nZ2dnZfqn_WdnZ2d@giganews.com>
References : 1 2 3
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
On 6/12/25 5:14 AM, Lawrence D'Oliveiro wrote:
On Thu, 12 Jun 2025 09:06:36 +0100, Richard Kettlewell wrote:
in particular the description of ExecStart and the Command Lines
section.
Just a note that the permitted syntax of systemd command lines is
deliberately restricted. It is not the fully general shell syntax.
The service is pretty simple :
. . .
[Unit]
Description=nCam_Recorder
[Service]
ExecStartPre=/bin/sleep 30
ExecStart=python3 "/root/scripts/nCamOperate.py3 /home/nas/shar/VidBak/camz/nCam/ 3"
Restart=on-failure
RestartSec=2s
[Install]
WantedBy=multi-user.target
. . .
I give it 30 seconds for everything to settle down after
booting, then run the actual program. If it ever crashes
the service with self-restart in a couple of seconds.
The pgm starts, but despite moving quotes around none of
the CL args get imported.
I'll look for more examples today ... it's SOME little
nuance in how I'm doing the CL args. Systemd can be
very useful here, you don't need your own watchdog
scripts, but I know the syntax can be finnicky.