Erwan David wrote:
2) add at the beginning of each /etc/init.d/myserv a test to stop if
the encrypted partition is not mounted
Neither of those solutions seems acceptable for me.
So if someone has an idea, I'm listening.
I would do one of two things. Either I would remove the /etc/rc?.d/S*
links associated with the services you don't want to start, or make
the script not executable. Then start them manually later as you
wish. Or I would install a /usr/sbin/policy-rc.d script that did your
automated check and only allowed the services to start if the disk was
mounted as you wish.
See the man page for invoke-rc.d for the first pass documentation.
Then read the README.policy-rc.d.gz file.