Let FreeBSD start service

xiaoxiao2021-03-06  15

Let FreeBSD start service

Today, configure a freebsd web server, I haven't made successful mysql and apache automatically started the problem. Today, I will meet, I will ask the netizens, say that just write a script to /usr/local/etc/rc.d, So I wrote a script, and I can't start the service after restarting the system.

depressed!

Later, he said that there is no property of the file to 755, I see, no, huh, set, restart, line.

for example:

For example, I want to launch MySQL, then I need to write a mysql.sh file with the following:

#! / bin / sh

/ usr / local / mysql / bin / mysqld_safe &

Then copy mysql.sh to /usr/local/tc/rc.d, then:

Chmod 755 /usr/local/etc/rc.d/mysql.sh

It is set to set it to the script file attribute to 755. You can automatically start the service after restarting the system!

Start other services like.

Of course, there is a method in addition to the above start service. Just add the service you want to start in /etc/rc.local, then you will start when the system starts. If the /etc/rc.local file does not exist, then create one. For example, we have to start our MySQL, then edit the file: ee /etc/rc.local then plus a line: / usr / local / MySQL / BIN / MYSQLD_SAFE & So the next system is started, MySQL is started, and if there is a lot of launch, you will put the start command according to this class.

In addition, there is still a problem today, which is the problem of deactivating Sendmail service, because I don't need this service, and it may also constitute a security threat. We know that ordinary deactivation of some inetd management services, all in /usr/rc.conf plus:

sshd_enable = "no"

Just do it, then I will add

Sendmail_enable = "no"

After restarting the system, PS looks at it, Sendmail is still, dizzy!

Ask netizens, I know that Sendmail is different from other things, must be set:

Sendmail_enable = "none"

After restart, you will not start sendmail!

Heiyeluren

2005/03/17

转载请注明原文地址:https://www.9cbs.com/read-46129.html

New Post(0)