Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I installed Debian 2.2r2 and upgrade to unstable,I want to compile apache php MySQL etc by myself.and I want to know
how to start some service(Apache MySQL..) at system booting
The usual method is to have it start and stop by placing a script in the /etc/rc.d/init.d directory. You then create symbolic links to that file in the appropriate run level directory. The run level directories exist in /etc/rc?.d (for example /etc/rc5.d is the directory holding the scripts for runlevel 5).
You will probably want to put your scripts in the rc5.d directory, but you might want to determine the multiuser runlevel first by running runlevel. This will print the previous and current runlevels on your server.
The symbolic links to the scripts have names with an S?? or K??. S are executed at startup, K during shutdown. The lower the number, the earlier that script is executed in the sequence.
A lot of times, there's a user contributed script that you can use, and just copy into init.d. Check the docs and subdirectories of your mysql, php and apache source. Since PHP isn't a listener, you won't be starting it up, but for apache and mysql these are definately processes it would be good to start and stop with the appropriate inet.d scripts.
These scripts usually follow the convention of honoring parameters like start, restart and stop. Look at some of the other scripts for examples.
Thank you very much,but i still have a question! Apache,proftpd,as I know there is no startup scripts like mysql.server in MySQL,how to start it at system booting?
#!/bin/bash
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 78 12
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid
# put this in the /etc/rc.d/init.d dir
# Source function library.
. /etc/rc.d/init.d/functions
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.