Toon posts:

proxy via script onder linux starten werkt niet

Pagina: 1
Acties:

Verwijderd

Topicstarter
ik heb de dnetc opstart script aangepast voor mijn proxy

swordfish:~# /etc/init.d/proxy
Usage: /etc/init.d/proxy {[-]start|[-]stop|[-]reload}
swordfish:~# /etc/init.d/proxy start
swordfish:~# /etc/init.d/proxy reload
swordfish:~# /etc/init.d/proxy stop
hij werkt zonder problemen


ik heb het volgende gedraaid en rechten gecontroleerd
cd /etc/init.d &&
ln -sf ../init.d/proxy ../rc0.d/K29proxy &&
ln -sf ../init.d/proxy ../rc1.d/K29proxy &&
ln -sf ../init.d/proxy ../rc2.d/K29proxy &&
ln -sf ../init.d/proxy ../rc3.d/S92proxy &&
ln -sf ../init.d/proxy ../rc4.d/S92proxy &&
ln -sf ../init.d/proxy ../rc5.d/S92proxy &&
ln -sf ../init.d/proxy ../rc6.d/K29proxy

als ik dan er na server reboot geeft die aan
cat: /home/victor/proxyper/rc5proxy.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
dit is logisch als proxy niet draait

maar bij opstarten start de proxy niet op
wie weet wat ik fout doe?

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
swordfish:~# cat /etc/init.d/dnetc
#! /bin/sh
#
# distributed.net client startup/shutdown script generated by 'dnetc -install'
# Use 'dnetc -uninstall' to stop the client from being started automatically.
#
# Don't forget to change buffer/.ini file perms if you wish to run suid'd.
#

CLIENT=/usr/dnetc/dnetc
STARTOPTS="-ini ${CLIENT}.ini"
#STARTOPTS will need to be in quotes if it has white space in it

test -f $CLIENT || exit 0

case "$1" in
        *start)
                $CLIENT -quiet -shutdown  # only allow one instance to run.
                $CLIENT -quiet $STARTOPTS # -quiet is 'mandatory' here.
                ;;
        *stop)  # sends SIGTERM to all running clients.
                $CLIENT -quiet -shutdown  # remove '-quiet' to see activity.
                ;;
        *reload)        # sends SIGHUP to all running clients.
                $CLIENT -quiet -restart   # remove '-quiet' to see activity.
                ;;
        *)
                echo "Usage: $0 {[-]start|[-]stop|[-]reload}"
                exit 1
                ;;
esac

exit 0

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
swordfish:~# cat /etc/init.d/proxy
#! /bin/sh
#
# distributed.net client startup/shutdown script generated by 'dnetc -install'
# Use 'dnetc -uninstall' to stop the client from being started automatically.
#
# Don't forget to change buffer/.ini file perms if you wish to run suid'd.
#

#CLIENT=/usr/dnetc/dnetc
CLIENT=/home/victor/proxyper/proxyper
#STARTOPTS="-ini ${CLIENT}.ini"
#STARTOPTS will need to be in quotes if it has white space in it

test -f $CLIENT || exit 0

case "$1" in
        *start)
                $CLIENT -hide
                ;;
        *stop)  # sends SIGTERM to all running clients.
                kill `cat /home/victor/proxyper/rc5proxy.pid`
                ;;
        *reload)        # sends SIGHUP to all running clients.
                kill `cat /home/victor/proxyper/rc5proxy.pid`
                $CLIENT -hide
                ;;
        *)
                echo "Usage: $0 {[-]start|[-]stop|[-]reload}"
                exit 1
                ;;
esac

exit 0

[ Voor 5% gewijzigd door Verwijderd op 13-04-2003 01:02 ]


Verwijderd

Verwijderd schreef op 13 April 2003 @ 00:59:
maar bij opstarten start de proxy niet op
wie weet wat ik fout doe?

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
case "$1" in
        *start)
                $CLIENT -hide
                ;;
        *stop)  # sends SIGTERM to all running clients.
                kill `cat /home/victor/proxyper/rc5proxy.pid`
                ;;
        *reload)        # sends SIGHUP to all running clients.
                kill `cat /home/victor/proxyper/rc5proxy.pid`
                $CLIENT -hide
                ;;
        *)
                echo "Usage: $0 {[-]start|[-]stop|[-]reload}"
                exit 1
                ;;
...
Begin es met die '*' weg te halen voor je start/stop/reload cases. Dus 'start)', 'stop)' en 'reload)' ipv '*start)', '*stop)' etc...

Verwijderd

Topicstarter
:( helpt niet

  • bkor
  • Registratie: November 2000
  • Niet online
Draai je nogsteeds Debian? Die start dacht ik in runlevel 2 (zie /etc/inittab) ipv 3 of 5 zoals RedHat/Mandrake. De foutmelding geeft al aan dat de proxy wordt gestopt ipv gestart.

Volgende regel is dus fout als ut Debian is (moet een S zijn):
ln -sf ../init.d/proxy ../rc2.d/K29proxy

Verwijderd

Topicstarter
bkor thanx dat werkt :)