From: Vinit Agnihotri Date: Tue, 1 Mar 2022 06:24:06 +0000 (+1100) Subject: packaging: move CTDB service file to top-level X-Git-Tag: tevent-0.12.0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93824b8c331cd43fea1d22a2d110e4e27fb0a02e;p=thirdparty%2Fsamba.git packaging: move CTDB service file to top-level Signed-off-by: Vinit Agnihotri Reviewed-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/ctdb.service b/packaging/systemd/ctdb.service.in similarity index 62% rename from ctdb/config/ctdb.service rename to packaging/systemd/ctdb.service.in index dbe35281f56..4494f914cff 100644 --- a/ctdb/config/ctdb.service +++ b/packaging/systemd/ctdb.service.in @@ -2,16 +2,16 @@ Description=CTDB Documentation=man:ctdbd(1) man:ctdb(7) After=network-online.target time-sync.target -ConditionFileNotEmpty=/etc/ctdb/nodes +ConditionFileNotEmpty=@CTDB_ETCDIR@/nodes [Service] Type=forking LimitCORE=infinity LimitNOFILE=1048576 TasksMax=4096 -PIDFile=/run/ctdb/ctdbd.pid -ExecStart=/usr/sbin/ctdbd_wrapper start -ExecStop=/usr/sbin/ctdbd_wrapper stop +PIDFile=@CTDB_RUNDIR@/ctdbd.pid +ExecStart=@SBINDIR@/ctdbd_wrapper start +ExecStop=@SBINDIR@/ctdbd_wrapper stop KillMode=control-group Restart=no diff --git a/packaging/wscript b/packaging/wscript index 1f9a54a787d..ab8e16f1ab9 100644 --- a/packaging/wscript +++ b/packaging/wscript @@ -41,10 +41,17 @@ def options(opt): +" Can be used multiple times."), action="append", dest="systemd_samba_extra", default=[]) + gr.add_option('--systemd-ctdb-extra', + metavar="Option=Value", + help=("Extra directives added to the ctdb service file." + +" Can be given multiple times."), + action="append", dest="systemd_ctdb_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.systemd_ctdb_extra = '\n'.join(Options.options.systemd_ctdb_extra) conf.env.SYSTEMDDIR = Options.options.SYSTEMDDIR diff --git a/packaging/wscript_build b/packaging/wscript_build index fbcd4e55f8c..217bd996348 100644 --- a/packaging/wscript_build +++ b/packaging/wscript_build @@ -12,5 +12,11 @@ for srv in systemd_services: if bld.env.systemd_install_services: bld.INSTALL_FILES(bld.env.SYSTEMDDIR, srv, flat=True) +if bld.env.with_ctdb: + srv = 'systemd/ctdb.service' + 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')