Code:
iggie@kittie:~$ ls -al /etc/rc.d/
total 156
drwxr-xr-x 2 root root 4096 Apr 26 21:54 .
drwxr-xr-x 36 root root 4096 May 12 00:05 ..
lrwxrwxrwx 1 root root 4 Apr 19 14:59 rc.0 -> rc.6
-rwxr-xr-x 1 root root 893 Jan 29 2003 rc.4
-rwxr-xr-x 1 root root 4782 Sep 12 2003 rc.6
-rwxr-xr-x 1 root root 2013 Feb 27 2003 rc.K
-rwxr-xr-x 1 root root 7634 Sep 15 2003 rc.M
-rwxr-xr-x 1 root root 8312 Aug 28 2003 rc.S
-rwxr-xr-x 1 root root 466 Aug 28 2003 rc.acpid
-rwxr-xr-x 1 root root 1514 Sep 5 2003 rc.alsa
-rwxr-xr-x 1 root root 119 Feb 27 2003 rc.font.sample
-rwxr-xr-x 1 root root 1156 Apr 20 23:10 rc.gpm
-rwxr-xr-x 1 root root 1136 Apr 20 22:59 rc.gpm-sample
-rwxr-xr-x 1 root root 1160 Mar 28 2003 rc.hotplug
-rw-r--r-- 1 root root 401 Mar 5 2003 rc.httpd
-rwxr-xr-x 1 root root 4038 Sep 21 2003 rc.inet1
-rw-r--r-- 1 root root 865 Apr 19 15:31 rc.inet1.conf
-rwxr-xr-x 1 root root 4419 Sep 21 2003 rc.inet2
-rw-r--r-- 1 root root 497 Sep 12 2003 rc.inetd
-rw-r--r-- 1 root root 1924 Sep 14 2003 rc.ip_forward
-rwxr-xr-x 1 root root 113 Oct 3 1995 rc.local
-rwxr-xr-x 1 root root 25454 Aug 29 2003 rc.modules
-rw-r--r-- 1 root root 2259 Sep 19 2003 rc.mysqld
-rw-r--r-- 1 root root 4790 Sep 18 2003 rc.pcmcia
-rwxr-xr-x 1 root root 2895 Aug 26 2003 rc.serial
-rw-r--r-- 1 root root 1222 Sep 23 2003 rc.sshd
-rwxr-xr-x 1 root root 861 May 29 2002 rc.syslog
-rwxr-xr-x 1 root root 1740 Sep 11 1999 rc.sysvinit
iggie@kittie:~$
npr
Code:
iggie@kittie:~$ cat /etc/rc.d/rc.sshd
#!/bin/sh
# Start/stop/restart the secure shell server:
sshd_start() {
# Create host keys if needed.
if [ ! -r /etc/ssh/ssh_host_key ]; then
/usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
/usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
fi
/usr/sbin/sshd
}
sshd_stop() {
killall sshd
}
sshd_restart() {
if [ -r /var/run/sshd.pid ]; then
echo "WARNING: killing listener process only. To kill every sshd process, you must"
echo " use 'rc.sshd stop'. 'rc.sshd restart' kills only the parent sshd to"
echo " allow an admin logged in through sshd to use 'rc.sshd restart' without"
echo " being cut off. If sshd has been upgraded, new connections will now"
echo " use the new version, which should be a safe enough approach."
kill `cat /var/run/sshd.pid`
else
killall sshd
fi
sleep 1
sshd_start
}
case "$1" in
'start')
sshd_start
;;
'stop')
sshd_stop
;;
'restart')
sshd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
iggie@kittie:~$
znaci samo napravis file rc.
servis i stavis mu chmod +x tako ce ga pri startapu slack sam exec
"nice town, i'll take it..."