From: Sage Weil Date: Wed, 29 Jul 2015 19:10:36 +0000 (-0400) Subject: systemd: add ceph-create-keys@ service X-Git-Tag: v9.1.0~439^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6842a20915a8a6ad88b97087a9134d54ec57d53d;p=ceph.git systemd: add ceph-create-keys@ service Signed-off-by: Sage Weil --- diff --git a/ceph.spec.in b/ceph.spec.in index 5090ebc66960..9fb780a8971e 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -548,6 +548,7 @@ install -D src/rbdmap $RPM_BUILD_ROOT%{_sysconfdir}/ceph/rbdmap install -m 0644 -D systemd/ceph-rgw.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}-rgw.conf install -m 0644 -D systemd/ceph-osd@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-osd@.service install -m 0644 -D systemd/ceph-mon@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-mon@.service + install -m 0644 -D systemd/ceph-create-keys@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-create-keys@.service install -m 0644 -D systemd/ceph-mds@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-mds@.service install -m 0644 -D systemd/ceph-radosgw@.service $RPM_BUILD_ROOT%{_unitdir}/ceph-radosgw@.service install -m 0644 -D systemd/ceph.target $RPM_BUILD_ROOT%{_unitdir}/ceph.target @@ -555,10 +556,10 @@ install -D src/rbdmap $RPM_BUILD_ROOT%{_sysconfdir}/ceph/rbdmap install -D src/init-ceph $RPM_BUILD_ROOT%{_initrddir}/ceph install -D src/init-radosgw $RPM_BUILD_ROOT%{_initrddir}/ceph-radosgw install -D src/init-rbdmap $RPM_BUILD_ROOT%{_initrddir}/rbdmap + ln -sf ../../etc/init.d/ceph %{buildroot}/%{_sbindir}/rcceph + ln -sf ../../etc/init.d/ceph-radosgw %{buildroot}/%{_sbindir}/rcceph-radosgw %endif mkdir -p $RPM_BUILD_ROOT%{_sbindir} -ln -sf ../../etc/init.d/ceph %{buildroot}/%{_sbindir}/rcceph -ln -sf ../../etc/init.d/ceph-radosgw %{buildroot}/%{_sbindir}/rcceph-radosgw install -m 0644 -D src/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/ceph install -m 0644 -D src/rgw/logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/radosgw chmod 0644 $RPM_BUILD_ROOT%{_docdir}/ceph/sample.ceph.conf @@ -637,7 +638,7 @@ mkdir -p %{_localstatedir}/run/ceph/ # /etc/systemd/system. May as well stop them too for completeness # (although strictly service_del_preun would do that anyway by dint # of stopping ceph.target) - SERVICE_LIST=$(systemctl | grep -E '^ceph-mon@|^ceph-osd@|^ceph-mds@' | cut -d' ' -f1) + SERVICE_LIST=$(systemctl | grep -E '^ceph-mon@|^ceph-create-keys@|^ceph-osd@|^ceph-mds@' | cut -d' ' -f1) if [ -n "$SERVICE_LIST" ]; then for SERVICE in $SERVICE_LIST; do /usr/bin/systemctl --no-reload disable $SERVICE > /dev/null 2>&1 || : @@ -692,14 +693,16 @@ mkdir -p %{_localstatedir}/run/ceph/ %{_bindir}/cephfs-data-scan %{_bindir}/ceph-debugpack %{_bindir}/ceph-coverage -%{_initrddir}/ceph %if 0%{?_with_systemd} %{_tmpfilesdir}/%{name}.conf %{_unitdir}/ceph-mds@.service %{_unitdir}/ceph-mon@.service +%{_unitdir}/ceph-create-keys@.service %{_unitdir}/ceph-osd@.service %{_unitdir}/ceph-radosgw@.service %{_unitdir}/ceph.target +%else +%{_initrddir}/ceph %endif %{_sbindir}/ceph-disk %{_sbindir}/ceph-disk-activate @@ -802,7 +805,9 @@ mkdir -p %{_localstatedir}/run/ceph/ %config %{_sysconfdir}/bash_completion.d/rados %config %{_sysconfdir}/bash_completion.d/rbd %config(noreplace) %{_sysconfdir}/ceph/rbdmap +%if 0%{?_with_systemd} %{_initrddir}/rbdmap +%endif %{python_sitelib}/ceph_argparse.py* %{python_sitelib}/ceph_daemon.py* %{_udevrulesdir}/50-rbd.rules @@ -834,7 +839,6 @@ fi ################################################################################# %files radosgw %defattr(-,root,root,-) -%{_initrddir}/ceph-radosgw %{_bindir}/radosgw %{_bindir}/radosgw-admin %{_mandir}/man8/radosgw.8* @@ -846,6 +850,8 @@ fi %dir %{_localstatedir}/lib/ceph/radosgw %if 0%{?_with_systemd} %{_tmpfilesdir}/%{name}-rgw.conf +%else +%{_initrddir}/ceph-radosgw %endif %post radosgw diff --git a/systemd/Makefile.am b/systemd/Makefile.am index 8c7c12811ffd..efe7245c9ce5 100644 --- a/systemd/Makefile.am +++ b/systemd/Makefile.am @@ -2,6 +2,7 @@ unitfiles = \ ceph.target \ ceph-mds@.service \ ceph-mon@.service \ + ceph-create-keys@.service \ ceph-osd@.service \ ceph-radosgw@.service diff --git a/systemd/ceph-create-keys@.service b/systemd/ceph-create-keys@.service new file mode 100644 index 000000000000..781e6b850f44 --- /dev/null +++ b/systemd/ceph-create-keys@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Ceph cluster key creator task + +# the last key created is the mds bootstrap key -- look for that. +ConditionPathExists=!/var/lib/ceph/bootstrap-mds/ceph.keyring + +[Service] +EnvironmentFile=-/etc/sysconfig/ceph +Environment=CLUSTER=ceph +ExecStart=/usr/sbin/ceph-create-keys --cluster ${CLUSTER} --id %i diff --git a/systemd/ceph-mon@.service b/systemd/ceph-mon@.service index 421897dc0d0d..2e884507e8e9 100644 --- a/systemd/ceph-mon@.service +++ b/systemd/ceph-mon@.service @@ -1,14 +1,13 @@ [Unit] Description=Ceph cluster monitor daemon -After=network-online.target -Wants=network-online.target # According to: # http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget # these can be removed once ceph-mon will dynamically change network # configuration. -After=network-online.target local-fs.target -Wants=network-online.target local-fs.target +After=network-online.target local-fs.target ceph-create-keys@%i.service +Wants=network-online.target local-fs.target ceph-create-keys@%i.service + PartOf=ceph.target [Service]