[systemd-devel] SSL handshake error from offlineimap when using systemd to initialize
Yubin Ruan
ablacktshirt at gmail.com
Wed Jan 24 07:13:36 UTC 2018
On Tue, Jan 23, 2018 at 04:10:10PM +0100, Lennart Poettering wrote:
> On Di, 23.01.18 09:09, Reindl Harald (h.reindl at thelounge.net) wrote:
>
> > > I got in the configuration file
> > >
> > > [Unit]
> > > After=network.target
> > >
> > > Isn't this enough to get the initialization order right?
> >
> > no, the target does more or less nothing useful
>
> Well, it doesn't do what Yubin assumes it does, but it certainly does
> something "useful": while it doesn't make the network *connectivity*
> is up, it does make sure the network *subsystem* is. And that does have
> uses: during shutdown it makes sure that your service is terminated
> before the network subsystem goes away. During start-up otoh it is
> indeed with little effect usually.
>
> > depeding on how your network is configured use "network.service" or
> > "networkmanager.service" (or however the networkmanager service is called in
> > detail, i don#t use it)
>
> Nope. Use "network-online.target" if you are looking for a generic
> unit to order after that is reached only after the network has been
> "configured" for the first time, for some vague definition of
> "configured", that is up to the networking implementation to fill with
> sense...
Now I have these in the configuration file
[Unit]
Description=Sync mail
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=oneshot
ExecStart=/path/to/the/script
TimeoutStartSec=1min30s
[Install]
WantedBy=default.target
However the script is still broken at system startup. Hmm...I am using a
Ubuntu 16.04LTS. I will post if there are any news.
--
Yubin
More information about the systemd-devel
mailing list