How to distinguish if a systemd unit is run by apt-get or during boot?

Michael Biebl biebl at debian.org
Wed May 20 23:47:10 BST 2015


Am 21.05.2015 um 00:40 schrieb Patrick Schleizer:
> Hi!
> 
> Can one somehow distinguish if,
> 
>     a) the daemon was started during boot or,
>     b) (re)started by an apt-get install or upgrade?
> 
> Can this be distinguished from within the daemon itself?

Not afaik.

> The use case is here to have script that is run by systemd
> 'Type=oneshot' only run on boot. Not during apt-get install or upgrades.

See man dh_systemd_start/dh_installinit. In your case, you probably want
the "--no-start" switch.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150521/891eaaaa/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list