There are two ways of doing this:
One way is to configure the service based on the run level
One way is to perform a local special configuration
For example, the task is to run the command at startup Hacker
Mode one:
1, set up the/etc/rc.d/init.d/hacker of the start script
Content is:
#!/bin/bash
/usr/local/bin/hacker
Set the properties of the file to executable: #chmod +x/etc/rc.d/init.d/hacker
2. View computer Run level
See Id:5:initdefault in file/etc/inittab:, then this system runs at level 5
3. To the/ETC/RC5.D directory, make a soft connection to the executable file you want to execute, and at the beginning of the name with a capital S letter, the number size after s represents the order of execution, the larger the number, the higher the execution.
#ln-S/ETC/RC.D/INIT.D/HACKER/ETC/RC5.D/S100CVSLOCKD
#ln-S/ETC/RC.D/INIT.D/HACKER/ETC/RC0.D/K20CVSLOCKD
Mode two: Add Exec/usr/local/bin/hacker in/etc/rc.d/rc.local
The way is to start the hacker at the end
There is another way:
Configure. bashrc files
VI ~/.BASHRC
You just need to join/home/xxx/xxx/bin/hacker.sh start to create a program that starts automatically when a user logs on.