Server 4 start and close » History » Version 1
iri, 10/07/2012 04:34 PM
1 | 1 | iri | h1. How to start and close the server 4 on GNU/Linux system ? |
---|---|---|---|
2 | |||
3 | Once installed, the Scol server will start at each system reboot, if the option is checked during the installation. However, you might want to do this manually. |
||
4 | |||
5 | h3. Basically, to close the server, this command should be enough : |
||
6 | |||
7 | <pre>killall -TERM usmunix</pre> |
||
8 | |||
9 | And to restart the server (from the Scol directory) : |
||
10 | <pre>nohup ./startscol.sh &</pre> |
||
11 | |||
12 | h3. You might want also a simple script. You could write something like that (change the content of _PATH_SCOL_) : |
||
13 | |||
14 | <pre> |
||
15 | #!/bin/bash |
||
16 | |||
17 | PATH_SCOL=/path/where/Scol/is/installed/ |
||
18 | PATH_CURRENT=$PWD |
||
19 | |||
20 | case "$1" in |
||
21 | 'start') |
||
22 | cd $PATH_SCOL |
||
23 | nohup ./startscol.sh & |
||
24 | cd $PATH_CURRENT |
||
25 | ;; |
||
26 | 'stop') |
||
27 | if ps -d | grep usmunix; then |
||
28 | killall -TERM usmunix |
||
29 | fi |
||
30 | ;; |
||
31 | *) |
||
32 | echo "Usage: $0 { start | stop }" |
||
33 | ;; |
||
34 | esac |
||
35 | exit 0 |
||
36 | </pre> |
||
37 | |||
38 | Don't forget a little _chmod_ : |
||
39 | <pre>chmod +x name_of_script</pre> |
||
40 | |||
41 | You can put also the script in your _/etc/init.d_ directory. The rights on the script must be sufficient for start and close Scol. |
||
42 | |||
43 | h3. To call the script : |
||
44 | |||
45 | Here, the script has been named c_scol.sh |
||
46 | |||
47 | <pre> |
||
48 | cd path_to_script |
||
49 | ./lc_scol.sh start |
||
50 | </pre> |
||
51 | |||
52 | and |
||
53 | |||
54 | <pre> |
||
55 | cd path_to_script |
||
56 | ./lc_scol.sh stop |
||
57 | </pre> |