S
S
sajgak2011-02-25 22:33:23
linux
sajgak, 2011-02-25 22:33:23

Debian autoload commands?

Please tell me how to execute the command with the given parameters after loading the entire system.
Tried creating a local file in /etc/init.d/

#!/bin/sh<br/>
comand -param value<br/>

there is no right to perform. There is
sudo update-rc.d local defaults 80
no result.
Thanks in advance

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
kmike, 2011-02-26
@sajgak

Without root - you can add it to crontab, where you can specify @reboot instead of dates. There will be no normal control of the startup sequence, etc., but for many purposes this solution is suitable.

V
Vlad Zhivotnev, 2011-02-25
@inkvizitor68sl

/etc/rc.local = auto start.
If you want to add a file to init, then write the script correctly, and not from the bullshit.

D
darkslesh, 2011-02-25
@darkslesh

in /etc/init.d/ you throw a file something like:

  1. #!/bin/bash
  2.  
  3. case $1 in
  4.   start)
  5.     Действие при старте
  6.     ;;
  7.   stop)
  8.       Действие при остановке
  9.     ;;
  10.   restart|reload)
  11.     $0 stop
  12.     sleep 3
  13.     $0 start
  14.     ;;
  15.   status)
  16.     действие при запросе статуса
  17.     ;;
  18.   *)
  19.     echo "Usage: $0 {start|stop|restart|reload|status}"
  20.     exit 1
  21.     ;;
  22. esac
  23.  
  24. exit 0
* This source code was highlighted with Source Code Highlighter.

Next, you specify when it should start
ln -s /etc/init.d/FILE_NAME /etc/rcN.d/S91xxxxxx
Where N is the system state at which the service should be started
0 - system stop
1 - boot in single user mode
2 - boot into multi-user mode without network support
3 - boot into multi-user mode with network support
4 - not used
5 - boot into multi-user mode with network support and graphical logon
6 - reboot
S91 - startup order
xxxxxx - any unique name. it is desirable that it be the same as in init.d so as not to be confused

K
Konstantin, 2011-02-25
@evil_random

write in /etc/rc.local
the service must be able to start as far as I know in order for it to start from init.d

A
Artyom Zubkov, 2011-02-25
@artzub

in order for the script to be executed from init.d during system startup, it must be generated according to the template that is in the file /etc/init.d/sceleton

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question