[Samba] Change machine name without a reboot?
L.P.H. van Belle
belle at bazuin.nl
Wed Feb 24 13:58:24 UTC 2016
Wasn't systemd using the following order.
1) config from /lib/systemd/... etc..
2) override config with /etc/systemd/... etc ..
And to add a unit file snippet, which can be used to append or
override settings in the default unit file, simply use :
systemctl edit smb.service
or
systemctl edit --full smb.service
Edit creates the needed dir/files in /etc/systemd
And adds a override.conf
and reload
systemctl daemon-reload
done. ;-)
Greetz,
> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens Reindl Harald
> Verzonden: woensdag 24 februari 2016 14:27
> Aan: samba at lists.samba.org
> Onderwerp: Re: [Samba] Change machine name without a reboot?
>
>
>
> Am 24.02.2016 um 14:16 schrieb mathias dufresne:
> > Systemd service files are generally coming with packages. This means
> these
> > files can be overwritten by some system update if this updates also your
> > Samba packages (note: I never had nor tested that behaviour with Samba
> > packages, but it happens for other packages).
>
> what you are saying only is true fpr sysvinit-scripts but not for
> systemd-units when you have some clue what you are doing
>
> that's why you place your own systemd units below /etc/systemd/system/
> with the same name or use dropins
>
> * disable service with "systemctl disable smb.service"
> * place your modified copy at /etc/systemd/system/smb.service
> * enable service with "systemctl enable smb.service"
> * voila the symlink points to your unit and no longer
> to /usr/lib/systemd/system/smb.service
>
> https://coreos.com/os/docs/latest/using-systemd-drop-in-units.html
>
> > 2016-02-23 8:39 GMT+01:00 L.P.H. van Belle <belle at bazuin.nl>:
> >
> >> Uh... just add :
> >>
> >> netbios name = PC_NAME
> >>
> >>> -----Oorspronkelijk bericht-----
> >>> Van: samba [mailto:samba-bounces at lists.samba.org] Namens Paul D.
> DeRocco
> >>> Verzonden: dinsdag 23 februari 2016 0:35
> >>> Aan: Samba list
> >>> Onderwerp: [Samba] Change machine name without a reboot?
> >>>
> >>> I'm having trouble changing the machine name programmatically on Samba
> 4
> >>> (running under systemd). There's no "netbios name" option in smb.conf,
> so
> >>> I'm relying on it using the hostname. Here's what I'm doing:
> >>>
> >>> 1) Call sethostname() with the new name.
> >>>
> >>> 2) Write the same name into /etc/hostname, to make it nonvolatile.
> >>>
> >>> 3) Read a decimal number from /var/run/smbd.pid.
> >>>
> >>> 4) Send SIGHUP to that process.
> >>>
> >>> Nothing happens. If I reboot, then the new name is announced on the
> >>> network. How do I get it to do this without rebooting the entire
> system?
>
> --
> To unsubscribe from this list go to the following URL and read the
> instructions: https://lists.samba.org/mailman/options/samba
More information about the samba
mailing list