Answer the question
In order to leave comments, you need to log in
Where are certain commands written to autoload in Debian OS?
There is a command that I need to use every time the system boots. Somehow I'm already tired, where is the best place to write this command so that it starts up before the X's start? Since this command concerns the network, or rather the firewall, where would it be most correct to write it down? PS what was found on the network was like that without explanation, but I know that there are several levels, but I have not yet encountered a similar task!
Answer the question
In order to leave comments, you need to log in
in fact, everything is easy.
there are /etc/rc.x directories, where x are runlevels. If my sclerosis does not change me, then the garbage starts automatically on the 5th. in the catalog there are a lot of symlinks to start scripts of all kinds. symlinks start with S (starting) or K (kill - stopping) and a number. Start - in accordance with the numbers, scripts are launched with S. On shutdown - with K. If you want - shove your script into /etc/init.d and make a symlink to it from /etc/rc.5 .
If we are talking specifically about the firewall (rule for iptables?), then classically there is something like a firewall_save script that saves your current set of rules and applies them at startup.
And last but not least, the easiest option. /etc/rc.local write your commands at the very end. this script is executed at the very end of startup
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question