Le mercredi 10 août 2011 à 09:58 +0200, Andreas Jaeger a écrit :
On Wednesday, August 10, 2011 09:53:56 Alin Marin Elena wrote:
Hi All,
I have decided to give a try to systemd... and it seems to work... after one waits 5 minutes or so (hope this bug gets fixed soon).
Yeah, hope so as well ;). It does not happen for everybody.
However I have a small script that gets inserted in /etc/init.d/alsasound like this # See how we were called. case "$1" in start) if [ "$PREVLEVEL" = "N" ]; then test -d /proc/asound && start_rest else start_all fi /bin/bash /etc/imic.sh ;;
what changes shall I do to make systemd do the same?
None right now ;). systemd calls the "old" init scripts as long as there are no replacements - and there is no replacement for alsasound yet, so the init script is used as is.
In general the above is a bad idea since you have to remember changing the file everytime alsasound gets updated, better create a separate file that is dependend on alsasound and starts afterwards
Yes.
Something like :
cat << EOF > /etc/systemd/system/default.target.wants/imic.service
[Unit]
Description=Fix the mic
After=alsasound.service
[Service]
Type=oneshot
ExecStart=/bin/bash /etc/imic.sh
EOF
then systemctl daemon-reload
and then test it with
systemctl start imic.service
I didn't test the service file, so errors are left to the readers as an
exercice :)
You can find more informations about how to write systemd unit files
at :
http://0pointer.de/blog/projects/systemd-for-admins-3.html
--
Frederic Crozat