August 25, 2010

FreeBSD now has the service command

Filed under: FreeBSD,PC-BSD — J. Abram barneck @ 9:47 pm

So I was reading the FreeBSD 8.1 release notes today and noticed that FreeBSD added the services command.

Basically there are a lot of start up scripts in /etc/rc.d that are enabled in the /etc/rc.conf.  However, if you wanted to restart them, you always had to run /etc/rc.d/someservice start.  And if you didn’t remember the exact service syntax, you had to ls the dir.

Anyway, now with the services command, you can simple type this:

service someservice start

service someservice restart

I am familiar with this already as that is how Red Hat gets things done with their services.

If it was just /etc/rc.d scripts that this worked for, then this command doesn’t really save much typing. But it also works for installed services or services from ports. The start up scripts for services for ports are in /usr/local/etc/rc.d.

So after installing something you can use the simple service command to start it, instead of typing in the longer path.

Of course, service has other features, such as listing the start up scripts in the two directories: /etc/rc.d and /usr/local/etc/rc.d

Take a second to run man service to see all its options.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at WordPress.com.

%d bloggers like this: