Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > The Community > Everything BSD
Reload this Page Equivalent to chkconfig / update-rc.d on FreeBSD 6.2???
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Everything BSD For all discussions regarding Free/NetBSD and OpenBSD.

Reply
 
Thread Tools Display Modes
Old 02-17-2008   #1 (permalink)
Saltamontes
Just Joined!
 
Join Date: Oct 2007
Location: Mexico
Posts: 42
Equivalent to chkconfig / update-rc.d on FreeBSD 6.2???

Hello to All

The title says all

I have using Linux ( Debian, Mandriva, CentOS ) because im trying to "stand up" an IDS . . .

Now im trying FreeBSD 6.2 because looks very interesting, and the writer of a book wich i have reading uses FreeBSD.

And i will try to duplicate the IDS with FreeBSD.

Now... the main parts of the IDS are te Server (store data on a DB) and a Sensor, both uses startup scripts to start on boot, and chkconfig / update-rc.d are used for that.

( that scripts located in /etc/init.d on Linux )

Which command is used for adding a statup script on boot ???
( or i have to copy someting to rc1, rc2 . . . by hand ? )

Thanks to all
Saltamontes is offline   Reply With Quote
Old 02-17-2008   #2 (permalink)
daark.child
Linux Guru
 
daark.child's Avatar
 
Join Date: Apr 2006
Location: South Yorks, UK
Posts: 3,207
You edit /etc/rc.conf and add something like
Code:
service_enable="YES"
To start the service immediately without rebooting,
Code:
/usr/local/etc/rc.d/service start
You may have to adjust your path depending on where the service is installed. If you created your own startup script, you probably should save it in /usr/local/etc/rc.d. Also take a look at the FreeBSD handbook because it has more details about managing services.
daark.child is offline   Reply With Quote
Old 05-29-2008   #3 (permalink)
Saltamontes
Just Joined!
 
Join Date: Oct 2007
Location: Mexico
Posts: 42
Hello again

i have been "playing" with FreeBSD again (now 7.0), and i'm interested to load some scripts on startup (i dont know if is necesary to convert them in daemons)...

that scripts was written for Red Hat like distributions, and with some fixes can run in Debian...

i have cheked that part of handbook that you talk about (Starting Services)

then, i have to add that part:
...
utility_enable=${utility_enable-"NO"}
utility_flags=${utility_flags-""}
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
...

in order to load that scripts (and executhe their tasks) on boot???

The scripts have this form (for Red Hat "chkconfig")
Code:
#!/bin/bash
# chkconfig: 2345 80 13
# description: Starts and stops SGUIL security monitoring server. \

# Source function library.
. /etc/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

sguild="/usr/local/sguil/server/sguild"
prog="sguild"
sguil_user="sguil"

start() {
    echo -n $"Starting $prog: "
    RETVAL=0
    daemon --user $sguil_user $sguild -P /var/run/sguil/sguild.pid -O /usr/local/tcltls/lib/libtls1.50.so -D

    RETVAL=$?
    echo
}

stop() {
    echo -n $"Shutting down $prog: "
    kill -9 `ps -auxww | grep tclsh | grep sguild | awk '{print $2}'`
    echo
}

status() {
    NUM_PROCS=`ps -auxww | grep tclsh | grep sguild | grep -v grep | awk '{print $2}' | wc -l`

    if [ $NUM_PROCS -eq 3 ]; then
        echo "Sguild daemon is UP"
        exit 0
    else
	# The funky sed is necessary to chop some extra spaces before 
	# $NUM_PROCS, which were inserted by the output from "wc -l" above.
        echo "Sguild daemon is DOWN ($NUM_PROCS/3 processes up)" | sed -e 's/\s\s//g'
        exit -1
    fi
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
	stop
	sleep 3
	start
	;;
  status)
	status 
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|status}"
	exit 1
esac
Thanks to everybody

See you
Saltamontes is offline   Reply With Quote
Old 4 Weeks Ago   #4 (permalink)
Saltamontes
Just Joined!
 
Join Date: Oct 2007
Location: Mexico
Posts: 42
Solved.

i did it, and the solution is shown in the post "custom script don't run on boot".

i can't solve the start/stop/restart options with the "good way", i did a complementary script using "kill + grep", and "rm -f pidfile", is not elegant, but works.

also, i can see something, the startup script dont works if is located on /usr/local/etc/rc.d/ only works on /etc/rc.d, i dont know why.

Thanks anyway

See you
Saltamontes is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I update locally, from RH ES 3 Update 5 to Update 9 plessm Redhat / Fedora Linux Help 0 12-13-2007 03:27 PM
Linux with FreeBSD chopin1810 Misc 3 08-16-2005 07:39 PM
FreeBSD on AMD64 problems? **CLOSED** techieMoe Everything BSD 18 04-14-2005 05:51 PM
got yum to work-now have rpm s but install failed :-( stomp10 Linux Newbie 7 01-15-2005 12:19 PM
Mandrake update thllgo Installation 9 09-26-2003 03:28 AM


All times are GMT. The time now is 11:02 PM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0