> From: Reindl Harald > > besides that you did not provide the info "embedded system" - > when you > have systemd you also have "systemctl restart > whatever.service" and in > PHP it would be passthru('command') > > you don't know how you restart a service via CLI - seriously?I know how to do it through systemctl, but I was wondering if there was a way to do it directly, say through a different signal to smbd. Killing smbd doesn't work--it doesn't get restarted. I'd like to find a lightweight way to do it programmatically from within my own service (written in C), without resorting to fork/exec* to call systemctl. -- Ciao, Paul D. DeRocco Paul mailto:pderocco at ix.netcom.com
Am 23.02.2016 um 01:30 schrieb Paul D. DeRocco:>> From: Reindl Harald >> >> besides that you did not provide the info "embedded system" - >> when you >> have systemd you also have "systemctl restart >> whatever.service" and in >> PHP it would be passthru('command') >> >> you don't know how you restart a service via CLI - seriously? > > I know how to do it through systemctl, but I was wondering if there was a > way to do it directly, say through a different signal to smbd. Killing > smbd doesn't work--it doesn't get restarted. I'd like to find a > lightweight way to do it programmatically from within my own service > (written in C), without resorting to fork/exec* to call systemctlwhy do you need it? sounds more "i like it" systemctl is the interface in doubt "it doesn't get restarted" - because you did not tell systemd to do so mine does..... Restart=always RestartSec=1 ____________________________________ [root at srv-rhsoft:~]$ cat /etc/systemd/system/smb.service [Unit] Description=Samba SMB Daemon [Service] Type=forking LimitNOFILE=32768 ExecStart=/usr/sbin/smbd -D Restart=always RestartSec=1 Nice=19 PrivateTmp=yes PrivateDevices=yes CapabilityBoundingSet=CAP_CHOWN CAP_SETGID CAP_SETUID CAP_DAC_OVERRIDE CAP_KILL CAP_NET_BIND_SERVICE CAP_IPC_LOCK CAP_SYS_CHROOT ReadOnlyDirectories=/etc ReadOnlyDirectories=/usr ReadOnlyDirectories=/var/lib ReadWriteDirectories=/var/lib/samba ReadWriteDirectories=/usr/local -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20160223/f84851b1/signature.sig>
> From: Reindl Harald > > why do you need it? > sounds more "i like it" > systemctl is the interface in doubt > > "it doesn't get restarted" - because you did not tell systemd to do so > mine does..... > > Restart=always > RestartSec=1Yes, I like it. Or rather, I don't like doing heavyweight things like cloning my process and launching another one when something small and fast will do. But I think you've solved my problem: I can certainly add "Restart=always" to my smb.service file, and then send a kill signal. I'll give it a try. Thanks. -- Ciao, Paul D. DeRocco Paul mailto:pderocco at ix.netcom.com