Debian: Init script confused by options
Starting the automounter in Debian:
Quoted 2 lines
[Psilocybe] update #
/etc/init.d/autofsstart
Starting automounter: --ghost.
This doesn't look very pretty. Function "debian" in the start script reads the output from getmounts assuming that the first thing after the command is the mount point. However, it might be an option. It wouldn't do to skip everything after the daemon name up to the first thing that does not start with a dash and then assume that the next thing is the mount point, since some options take arguments. These arguments may start with dashes or slashes.
The fix below assumes that the mount point will be the first thing that starts with a slash and is followed by something that starts with a letter (the map type). A bit ugly, but it will still work with option arguments that starts with dashes or slashes; also, it doesn't need to know a thing about which options there are and whether they take any arguments or not. As long as the mount point starts with a slash and the map type starts with a letter, we're fine.
(Does anyone have a better idea?)
With patch:
Quoted 2 lines
[Psilocybe] update #
/etc/init.d/autofsstart
Starting automounter: /slask.
Another thing; the /var/run/autofs.*.pid files that the debian function tries to use when reloading are actually never created. Adding --make-pidfile to start-stop-deamon would probably do the trick, but then it'd be nice to also delete old pid files so we don't keep them around and try to reload the settings of their deceased daemons forever. I haven't addressed this.
Thorild Selén
Datorföreningen Update / Update Computer Club, Uppsala, SE
samples/rc.autofs.in +3 -2
@@ -441,12 +441,13 @@ case "$1" in start) echo -n 'Starting automounter:' - getmounts | while read cmd mnt rest + getmounts | while read cmd rest do + mnt=`echo $rest | sed 's/^.* \(\/[^ ]*\) [A-Za-z].*$/\1/'` echo -n " $mnt" pidfile=/var/run/autofs`echo $mnt | sed 's/\//./'`.pid start-stop-daemon --start --pidfile $pidfile --quiet \ - --exec $DAEMON $daemonoptions -- $mnt $rest + --exec $DAEMON $daemonoptions -- $rest done echo "." ;;
[email protected]
maintainerQuoted 5 lines · Thorild Selen
Starting the automounter in Debian:
Quoted 2 lines
[Psilocybe] update #
/etc/init.d/autofsstart
Starting automounter: --ghost.
Quoted 7 lines
This doesn't look very pretty. Function "debian" in the start script reads the output from getmounts assuming that the first thing after the command is the mount point. However, it might be an option. It wouldn't do to skip everything after the daemon name up to the first thing that does not start with a dash and then assume that the next thing is the mount point, since some options take arguments. These arguments may start with dashes or slashes.
Sorry Thorild.
Certainly I'm guilty of not tracking changes in the init with the Debian part.
What is really needed here is for the Debian maintainer to help out.
Are you there Daniel?
Quoted 10 lines
The fix below assumes that the mount point will be the first thing that starts with a slash and is followed by something that starts with a letter (the map type). A bit ugly, but it will still work with option arguments that starts with dashes or slashes; also, it doesn't need to know a thing about which options there are and whether they take any arguments or not. As long as the mount point starts with a slash and the map type starts with a letter, we're fine.
(Does anyone have a better idea?)
One day, when I get time.
In the mean time I'll use your supplied patch.
Thanks
Ian
Quoted 4 lines
Starting the automounter in Debian:
Quoted 2 lines
[Psilocybe] update #
/etc/init.d/autofsstart
Starting automounter: --ghost.
[...]
The init script used by the official Debian package isn't yet included in the upstream sources, i. e. the Debian-specific parts of the init script contained in the upstream sources is out of date. The init script of the official Debian package is currently generated from the init script contianed in the upstream sources by applying a lot of patches.
I recommend you to take the init script from the latest official Debian package.
Correct creation of pid files should also work with this script.
-Daniel
[email protected]
maintainerQuoted 14 lines · Daniel Lutz
Quoted 4 lines
Starting the automounter in Debian:
Quoted 2 lines
[Psilocybe] update #
/etc/init.d/autofsstart
Starting automounter: --ghost.[...]
The init script used by the official Debian package isn't yet included in the upstream sources, i. e. the Debian-specific parts of the init script contained in the upstream sources is out of date. The init script of the official Debian package is currently generated from the init script contianed in the upstream sources by applying a lot of patches.
Quoted 4 lines
I recommend you to take the init script from the latest official Debian package.
Correct creation of pid files should also work with this script.
Would you like me to try to merge this into the package Daniel?
There are some significat fixes to startup problems in the current version of autofs v4. I don't think they are fully accounted for in the Debian init script. As you know I have already merged a fair number of the Debian patches and taken steps to solve some other concerns, such as log verbosity.
What can I do to encourage you to upgrade from the 4.0.0pre10 base you are using. Sorry, I know it's quite a bit of work, but I'm certain the current version is more stable and functional than your current base.
Ian
Quoted 1 line
Would you like me to try to merge this into the package Daniel?
Currently, I have the following main concern with this:
- I think different distributions' init scripts have different behaviors. For example, Debian's init script supports /etc/nsswitch.conf and LDAP for auto.master since some time, but it behaves a bit different than for example RedHat's init script. I needed to do this for remaining compatible to older versions of the (Debian) package, so that upgrades of a Debian installation don't break the system.
I haven't yet tested it, but I think Debian's current init script should work more or less with autofs 4.1.x. So I would say merging this script into your package wouldn't be a big advantage for the moment, at least not for me.
Quoted 9 lines
There are some significat fixes to startup problems in the current version of autofs v4. I don't think they are fully accounted for in the Debian init script. As you know I have already merged a fair number of the Debian patches and taken steps to solve some other concerns, such as log verbosity.
What can I do to encourage you to upgrade from the 4.0.0pre10 base you are using. Sorry, I know it's quite a bit of work, but I'm certain the current version is more stable and functional than your current base.
I'm fully aware that an upgrade to 4.1.x would be the best thing to do, a lot of bugs in Debians bug tracking system could be closed. But unfortunately I'm still too busy for doing this big step.
-Daniel
[email protected]
maintainerQuoted 8 lines · Daniel Lutz
Quoted 4 lines
What can I do to encourage you to upgrade from the 4.0.0pre10 base you are using. Sorry, I know it's quite a bit of work, but I'm certain the current version is more stable and functional than your current base.
I'm fully aware that an upgrade to 4.1.x would be the best thing to do, a lot of bugs in Debians bug tracking system could be closed. But unfortunately I'm still too busy for doing this big step.
Understand.
If there's anything I can do let me know.
Ian