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

Re: Spawn long-running process from maintainer script?



On Sat, Oct 21, 2017 at 11:40:34AM +0200, Marc Haber wrote:
> Aide, however, is not a daemon, and the database init process started
> from postinst is a one-shot process running for several minutes and then
> terminating.

Is it supposed to provide an output?

Can it handle a reboot in the middle of processing?  There are people who
like to reboot right after upgrading, and there even are heretic ideas to
windowsize upgrade process by making this mandatory.

> What would be the recommended way to do this?
> 
> (1)
> remove the aide database init process from the package completely since
> it runs at a time when other packages are still being installed and the
> new database is outdated the second it is created?

By the above reason, it doesn't sound like something that can be safely done
in the background unless you have a way to restart the process.

> (2)
> continue using s-s-d and silence the lintian warning
> 
> (3)
> adopt the perl code from man-db
> 
> (4)
> use some other idiom ("&"? A systemd one-shot unit? Something entirely
> different?

nohup would be better than & (no issues with logout).  Using a systemd unit
would be pointless as you'd need to duplicate it the Unix way for
non-systemd users anyway -- and Unix way works with systemd (unless someone
uses KillUserProcesses=yes which is machinegunning one's foot).

> what would you recommend?

Definitely something that does the work in foreground.

It's your choice whether to do this in postinst (nicer) or manually invoked
by the user.  The other option, backgrounding, sounds like too much work for
a few minutes of gain, if you want to do so reliably.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ Laws we want back: Poland, Dz.U. 1921 nr.30 poz.177 (also Dz.U. 
⣾⠁⢰⠒⠀⣿⡁ 1920 nr.11 poz.61): Art.2: An official, guilty of accepting a gift
⢿⡄⠘⠷⠚⠋⠀ or another material benefit, or a promise thereof, [in matters
⠈⠳⣄⠀⠀⠀⠀ relevant to duties], shall be punished by death by shooting.


Reply to: