[sles-beta] question systemd

Frederic Crozat fcrozat at suse.com
Tue Sep 30 06:09:02 MDT 2014


Le mardi 30 septembre 2014 à 13:53 +0200, Günther J. Niederwimmer a
écrit :
> Am Dienstag, 30. September 2014, 13:08:42 schrieb Frederic Crozat:
> > Le mardi 30 septembre 2014 à 13:00 +0200, Günther J. Niederwimmer a
> > 
> > écrit :
> > > Hello,
> > > 
> > > I have two Problems with systemd, can any say way.
> > > 
> > > On a new installation I miss the
> > > 
> > > /etc/tmpfiles.d/tmp.conf
> > 
> > This is expected, we don't ship any files in /etc/tmpfiles.d by default,
> > since those are for administrators. All packaged tmpfiles.d files are
> > located in /usr/lib/tmpfiles.d (where you'll find tmp.conf)
> 
> OK thanks, this was a old Installation, only with "zypper dup" updated, so I 
> have the tmp.conf twice. 
> 
> > > The second Problem is, way work this on a reboot but not on start time
> > > 
> > > I make a new kinit.service, the cron parameter "@reboot" don't work
> > > anymore
> > > 
> > > /etc/tmpfiles.d/kinit.conf
> > > d /run/user/0/krb5cc 1777 root root -
> > > 
> > > /etc/systemd/system/kinit.service
> > > [Unit]
> > > Description=Kerberos initial kinit
> > > Wants=SuSEfirewall2_setup.service
> > > After=SuSEfirewall2_setup.service
> > > 
> > > [Service]
> > > Type=simple
> > > ExecStart=/usr/bin/kinit -k host/asmtp.gjn.prv
> > > Restart=on-failure
> > > RestartSec=30
> > > 
> > > [Install]
> > > WantedBy=multi-user.target
> > > 
> > > /etc/systemd/system/kinit.timer
> > > [Unit]
> > > Description=Fist Initialisation of KRB5
> > > 
> > > [Timer]
> > > OnBootSec=3min
> > > 
> > > [Install]
> > > WantedBy=timers.target
> > 
> > I'm not 100% sure I understand what you want to do. Could you elaborate
> > a bit more ?
> 
> I like to do, on start up a kinit -k host/......... for the first 
> initialisation from kerberos after the network is on, and the server is 
> running. (KVM Client)
> 
> with SLES 11 I make a cron file with the extra character "@reboot" but this 
> don't work with SLES 12 anymore.
> 
> so I google a bit and found a way with systemd. But my construct is only 
> working after a reboot and not on start up the system. :-(

On the dependency side, you should drop the "Wants" (it is not needed)
and replace After with:
After=network.target 

(this will ensure network is up before starting kinit).

You also should ensure kinit.service is enabled (running systemctl
enable kinit.service one time). This should be enough to have this unit
started each time 3min after booting is complete (please note systemd
doesn't make any difference between initial boot and reboot in the
startup sequence).


-- 
Frederic Crozat
Project Manager Enterprise Desktop
SUSE



More information about the sles-beta mailing list