Hogy is kell, gentoo alatt glassfish szervert indító scriptet csinálni. Álljon alább a példa:
Létrehozunk egy file-t /usr/local/bin/gf_start tartalma:
1 2 |
#!/bin/bash /opt/glassfish/glassfish3/bin/asadmin start-domain |
Kell egy stop is: /usr/local/bin/gf_stop tartalma:
1 2 |
#!/bin/bash /opt/glassfish/glassfish3/bin/asadmin stop-domain |
És maga az indító script /etc/init.d/glassfish aminek a tartalma:
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 |
#!/sbin/runscript depend() { need net } start() { ebegin "Starting glassfish" # Ensure that we run from a readable working dir, and that we do not # lock filesystems when being run from such a location. cd / start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/glassfish.pid --exec /usr/local/bin/gf_start eend $? } stop() { ebegin "Stopping glassfish" /usr/local/bin/gf_stop eend $? } restart() { if ! service_stopped "${SVCNAME}" ; then svc_stop || return "$?" fi svc_start } |