Hi Wolfgang,

On Sat, Mar 11, 2017 at 01:57:47PM +0100, Wolfgang Schweer wrote:
> Hi Evgeni,
> 
> On Sat, Mar 11, 2017 at 12:34:18PM +0100, Evgeni Golov wrote:
> > >  override_dh_installinit:
> > > - dh_installinit --onlyscripts
> > > + dh_installinit --only-scripts --no-start
> > 
> > Sadly, it is not that easy. --no-start implies that the daemon also won't be
> > re-started on upgrades. And you really want that ;)
> 
> Right; saw it too late. Maybe it would be an idea to generate d/postinst 
> manually to have more options (compared to dh_*) for the upgrade case? 
> I tried that, but w/o success so far.

I'd rather use the half-broken --no-start or rip out sysv support than
writing my own postinst (it just asks for doing something wrong :/).

Anyways. I actually think that writing "our own" postinst would not work
either. update-rc.d just does not give us enough support to do so.
 #705254 update-rc.d: Provide "is-enabled" command
 #857452 update-rc.d: please provide a defaults-disabled option

To recap, the behaviour should be as follows (IMHO):
on fresh install, the service is disabled and not started
on upgrade
* if the service was enabled, it remains enabled and gets restarted
* if the service was disabled, it remains so and is not started

For fresh install this is easy, just ommit the
 update-rc.d thinkfan defaults
call in postinst and be done (invoke-rc.d should behave properly)

For upgrades, we'd need something like:
 if update-rc.d thinkfan is-enabled;
   update-rc.d thinkfan defaults
 fi
or
 update-rc.d thinkfan defaults-desabled
Again, trusting that invoke-rc.d will behave properly afterwards.

But we don't have these commands :(

Reply via email to