[Service]
Type=notify
NotifyAccess=all
-PIDFile=/run/nmbd.pid
-EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/nmbd --foreground --no-process-group $NMBDOPTIONS
+PIDFile=@PIDDIR@/nmbd.pid
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/nmbd --foreground --no-process-group $NMBDOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID
LimitCORE=infinity
+@systemd_nmb_extra@
[Install]
WantedBy=multi-user.target
[Service]
Type=notify
NotifyAccess=all
-PIDFile=/run/samba.pid
+PIDFile=@PIDDIR@/samba.pid
LimitNOFILE=16384
-EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/samba --foreground --no-process-group $SAMBAOPTIONS
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/samba --foreground --no-process-group $SAMBAOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID
+@systemd_samba_extra@
[Install]
WantedBy=multi-user.target
[Service]
Type=notify
NotifyAccess=all
-PIDFile=/run/smbd.pid
+PIDFile=@PIDDIR@/smbd.pid
LimitNOFILE=16384
-EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/smbd --foreground --no-process-group $SMBDOPTIONS
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/smbd --foreground --no-process-group $SMBDOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID
LimitCORE=infinity
+@systemd_smb_extra@
[Install]
WantedBy=multi-user.target
[Service]
Type=notify
NotifyAccess=all
-PIDFile=/run/winbindd.pid
-EnvironmentFile=-/etc/sysconfig/samba
-ExecStart=/usr/sbin/winbindd --foreground --no-process-group "$WINBINDOPTIONS"
+PIDFile=@PIDDIR@/winbindd.pid
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/winbindd --foreground --no-process-group "$WINBINDOPTIONS"
ExecReload=/usr/bin/kill -HUP $MAINPID
LimitCORE=infinity
+@systemd_winbind_extra@
[Install]
WantedBy=multi-user.target
--- /dev/null
+#!/usr/bin/env python
+
+import Options
+
+def set_options(opt):
+ gr = opt.option_group('systemd installation options')
+
+ gr.add_option('--systemd-install-services',
+ help=("install systemd service files to manage daemons (default=no)"),
+ action="store_true", dest="systemd_install_services", default=False)
+
+ gr.add_option('--with-systemddir',
+ help=("systemd service directory [PREFIX/usr/lib/systemd/system]"),
+ action="store", dest="SYSTEMDDIR",
+ default="${PREFIX}/usr/lib/systemd/system")
+ #
+ # extra service directives
+ #
+
+ gr.add_option('--systemd-smb-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the smb service file."
+ +" Can be given multiple times."),
+ action="append", dest="systemd_smb_extra", default=[])
+
+ gr.add_option('--systemd-nmb-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the nmb service file."
+ +" Can be used multiple times."),
+ action="append", dest="systemd_nmb_extra", default=[])
+
+ gr.add_option('--systemd-winbind-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the winbind service file."
+ +" Can be used multiple times."),
+ action="append", dest="systemd_winbind_extra", default=[])
+
+ gr.add_option('--systemd-samba-extra',
+ metavar="Option=Value",
+ help=("Extra directives added to the samba service file."
+ +" Can be used multiple times."),
+ action="append", dest="systemd_samba_extra", default=[])
+
+def configure(conf):
+ conf.env.systemd_install_services = Options.options.systemd_install_services
+ conf.env.systemd_smb_extra = '\n'.join(Options.options.systemd_smb_extra)
+ conf.env.systemd_nmb_extra = '\n'.join(Options.options.systemd_nmb_extra)
+ conf.env.systemd_winbind_extra = '\n'.join(Options.options.systemd_winbind_extra)
+ conf.env.systemd_samba_extra = '\n'.join(Options.options.systemd_samba_extra)
+ conf.env.SYSTEMDDIR = Options.options.SYSTEMDDIR
--- /dev/null
+#!/usr/bin/env python
+
+systemd_services = [
+ 'systemd/smb.service',
+ 'systemd/nmb.service',
+ 'systemd/winbind.service',
+ 'systemd/samba.service'
+]
+
+for srv in systemd_services:
+ bld.CONFIGURE_FILE(srv)
+ if bld.env.systemd_install_services:
+ bld.INSTALL_FILES(bld.env.SYSTEMDDIR, srv, flat=True)
+
+if bld.env.systemd_install_services:
+ bld.INSTALL_FILES('${SYSCONFDIR}/sysconfig', 'systemd/samba.sysconfig', destname='samba')
opt.PRIVATE_EXTENSION_DEFAULT('samba4')
opt.RECURSE('lib/replace')
opt.RECURSE('dynconfig')
+ opt.RECURSE('packaging')
opt.RECURSE('lib/ldb')
opt.RECURSE('selftest')
opt.RECURSE('source4/lib/tls')
opt.RECURSE('lib/util')
opt.RECURSE('lib/crypto')
opt.RECURSE('ctdb')
+
+
opt.samba_add_onoff_option('pthreadpool', with_name="enable", without_name="disable", default=True)
opt.add_option('--with-system-mitkrb5',
conf.RECURSE('ctdb')
conf.RECURSE('lib/socket')
conf.RECURSE('auth')
+ conf.RECURSE('packaging')
conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
bld.RECURSE('dfs_server')
bld.RECURSE('file_server')
bld.RECURSE('lib/krb5_wrap')
+bld.RECURSE('packaging')
bld.RECURSE('testsuite/headers')