[Samba] Change machine name without a reboot?

Reindl Harald h.reindl at thelounge.net
Tue Feb 23 00:38:38 UTC 2016



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 systemctl

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=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>


More information about the samba mailing list