[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: restarting systemd user services on upgrade



Hi Paul,

thanks for your answer.

> These are not "systemd user services" as described in your email subject, they are
> per-user instances of systemd system services. Looking at the tor

Yes, indeed, that would be the better expression. Sorry for the mix up.

In this sense it is very similar to all other daemons. If we update
exim, systemd also restarts exim, right? And same with whatever daemon I
can imagine (besides X and ssh or so).

So that is the reason why I thought it would be nice to have a service
that restarts also root started daemons that run for users (the
@.service).

> package, it seems you need a onedrive.service in addition to

We ship also one onedrive.service. This is used when a user starts
	systemctl --user onedrive
which is ok, but is normally shut down. THus, we provide also the @
service (I say we, because I am also 1/4 upstream of onedrive, and the
service files etc come from upstream onedrive project).

> onedrive.target is what is needed for controlling multiple instances.

I am not sure what this would be needed for?

> Probably it would be best to consult the systemd upstream community
> about this.

What would I ask there? I asked about *Debian* specific actions during
apt/dpkg upgrades of the onedrive package. Upstream onedrive or Systemd
will not be interested in these specifics, right?

What about the following code in postinst?
    restart_units="`systemctl list-units --no-legend --type=service --state=running 'onedrive*' | awk '{print$1}'`"
    if ! [ "x$restart_units" = "x" ] ; then
      echo -n "Restarting running Onedrive processes ... "
      for unit in $restart_units ; do
        echo -n "$unit "
        systemctl restart "$unit"
      done
      echo "."
    fi
Would this be against any policy?

> PS: if you were talking about systemd user services (which run as the
> user rather than root and are shut down after the user's last session
> is closed, unless lingering is enabled for the user), then I would
> suggest looking at needrestart & needrestart-session.

Thanks, I have checked that, but I think I have removed needrestart
already 10 times from my computer, because it does a lot of things I
don't want it to do ;-)

Best

Norbert

--
PREINING Norbert                              https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


Reply to: