Control: tags -1 patch

Hi,

On Sat, 22 Aug 2015 22:22:00 -0300 fsate...@debian.org wrote:
> Your package hdparm has an initscript that is enabled in runlevel S,
> but it does not provide a corresponding systemd service unit.

Please find attached a service file that invokes the init script. The
init script is a full fledged program, so one cannot bypass it. A few
comments:

1. Init scripts should be thin wrappers around a real program. It
would be good to split the program out of the initscript and possibly
forward it upstream. Because initscripts are conffiles, changes in the
program are not guaranteed to be delivered to users.

2. The script should probably be changed to use /run/lock instead of
/var/lock, and add a dependency on mountkernfs. If this is done, then
the RequiresMountsFor should be dropped in the service file. The
current design is racy, as /var/lock is not guaranteed to exist by the
time hdparm runs (/var may be a remote filesystem). The move to /run
happened for wheezy so there should be no problem doing the switch.
Moreover, flock lives in /usr, which is not guaranteed to have been
mounted until mountall.sh has been run. This is not a problem under
systemd (the initramfs will mount /usr) but it is problematic for
sysvinit systems.

3. The init script does not check for the existence of /sbin/hdparm
and exit 0 if it does not exist (policy 9.3.2)

4. I do not see a reason to pause boot until hdparm has finished
running. Thus I removed the Before=sysinit.target ordering, and thus
removing a possible dependency loop when /var is a remote file system.


-- 
Saludos,
Felipe Sateler

Attachment: hdparm.service
Description: Binary data

Reply via email to