If you are using CentOS the answer is pretty simple:
[codesyntax lang="bash"]
chkconfig --list | grep $(runlevel | awk '{ print $2}'):on
[/codesyntax]
But how about Debian Linux? How is this done?
[codesyntax lang="bash"]
R=$(runlevel | awk '{ print $2}') for s in /etc/rc${R}.d/*; do basename $s | grep '^S' | sed 's/S[0-9].//g' ;done
[/codesyntax]
If you like - and I am sure most of you will - you can use rcconf, Debian Runlevel configuration tool.
0 Comentarii.