![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| different between soft reboot and hard reboot | seelan3 | SUN Solaris | 3 | 09-20-2006 11:12 PM |
| starting Oracle on Reboot | rahulrathod | SUN Solaris | 1 | 11-29-2005 09:04 AM |
| A doubt on Daemons | marioh | Linux | 4 | 06-21-2005 05:29 AM |
| Daemons | Pennywize | UNIX for Dummies Questions & Answers | 6 | 02-21-2003 06:43 AM |
| DNS daemons | Deuce | IP Networking | 8 | 11-29-2001 03:51 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Starting daemons at reboot.
I rebooted my server (solaris 5.8) and I had to manually start the cron and mailx daemons. How do I get these to automatically start at reboot?
Thanks in advance. |
| Forum Sponsor | ||
|
|
|
|||
|
In the directory "/etc/init.d" the following 2 files should be presend:
- cron - sendmail which look something like this: Code:
# cat cron
#!/sbin/sh
#
# Copyright (c) 1997-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)cron 1.13 98/04/19 SMI"
case "$1" in
'start')
if [ -p /etc/cron.d/FIFO ]; then
if /usr/bin/pgrep -x -u 0 -P 1 cron >/dev/null 2>&1; then
echo "$0: cron is already running"
exit 0
fi
fi
if [ -x /usr/sbin/cron ]; then
/usr/bin/rm -f /etc/cron.d/FIFO
/usr/sbin/cron &
fi
;;
'stop')
/usr/bin/pkill -x -u 0 -P 1 cron
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
Code:
# cat sendmail
#!/sbin/sh
#
# Copyright (c) 1992, 1995, 1997 - 2000 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)sendmail 1.16 00/09/06 SMI"
ERRMSG1='WARNING: /var/mail is NFS-mounted without setting actimeo=0,'
ERRMSG2='this can cause mailbox locking and access problems.'
case "$1" in
'start')
if [ -f /usr/lib/sendmail -a -f /etc/mail/sendmail.cf ]; then
if [ ! -d /var/spool/mqueue ]; then
/usr/bin/mkdir -m 0750 /var/spool/mqueue
/usr/bin/chown root:bin /var/spool/mqueue
fi
MODE="-bd"
if [ -f /etc/default/sendmail ]; then
. /etc/default/sendmail
fi
#
# * MODE should be "-bd" or null (MODE= or MODE="") or
# left alone. Anything else and you're on your own.
# * QUEUEINTERVAL should be set to some legal value;
# a sanity check is done below.
# * OPTIONS is a catch-all; set with care.
#
if [ -z "$QUEUEINTERVAL" ]; then
QUEUEINTERVAL="15m"
fi
case $QUEUEINTERVAL in
*s | *m | *h | *d | *w) ;;
*) QUEUEINTERVAL="15m" ;;
esac
if [ $QUEUEINTERVAL -le 0 ]; then
QUEUEINTERVAL="15m"
fi
/usr/lib/sendmail $MODE -q$QUEUEINTERVAL $OPTIONS &
#
# ETRN_HOSTS should be of the form
# "s1:c1.1,c1.2 s2:c2.1 s3:c3.1,c3.2,c3.3"
# i.e., white-space separated groups of server:client where
# client can be one or more comma-separated names; N.B. that
# the :client part is optional; see etrn(1M) for details.
# server is the name of the server to prod; a mail queue run
# is requested for each client name. This is comparable to
# running "/usr/lib/sendmail -qRclient" on the host server.
#
# See RFC 1985 for more information.
#
for i in $ETRN_HOSTS; do
SERVER=`echo $i | /usr/bin/sed -e 's/:.*$//'`
CLIENTS=`echo $i | /usr/bin/sed -n -e 's/,/ /g' \
-e '/:/s/^.*://p'`
/usr/sbin/etrn $SERVER $CLIENTS >/dev/null 2>&1 &
done
fi
if /usr/bin/nawk 'BEGIN{s = 1}
$2 == "/var/mail" && $3 == "nfs" && $4 !~ /actimeo=0/ &&
$4 !~ /noac/{s = 0} END{exit s}' /etc/mnttab; then
/usr/bin/logger -p mail.crit "$ERRMSG1"
/usr/bin/logger -p mail.crit "$ERRMSG2"
fi
;;
'stop')
/usr/bin/pkill -x -u 0 sendmail
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
- S75cron - S88sendmail if not present use the following commands: Code:
# cd /etc/rc2.d # ln /etc/init.d/cron S75cron # ln /etc/init.d/sendmail S88sendmail - K40cron - K36sendmail If not present use the following command: Code:
# cd /etc/rc0.d # ln /etc/init.d/cron K40cron # ln /etc/init.d/sendmail K36sendmail # cd /etc/rc1.d # ln /etc/init.d/cron K40cron # ln /etc/init.d/sendmail K36sendmail # cd /etc/rcS.d # ln /etc/init.d/cron K40cron # ln /etc/init.d/sendmail K36sendmail |