[Vserver] How to use init script

From: HongDan <hongdanstar_at_gmail.com>
Date: Mon 12 Jun 2006 - 05:33:53 BST
Message-ID: <000101c68dd9$6e9f6f80$4d18423b@deepinb6b12523>

I want to execute some tasks when a vserver is started, but I don't know how
to make it. I found an instruction in
http://www.solucorp.qc.ca/howto.hc?projet=vserver&id=56
But it seems that it doesn't work for util-vserver 0.30.210. Are there any
other ways to do it?

Bruno gave me a hint that I can change util-vserver to call a script in
/usr/lib/utils-vserver/vserver.start. I found these commands in it:

pushd "$VSERVER_DIR"/vdir/ >/dev/null
execScriptlets "$VSERVER_DIR" "$VSERVER_NAME" post-start
popd >/dev/null

So I tried touching a file "post-start" in /etc/vservers/<guestname>/, and
put my initscript in "post-start". But it doesn't work either. Am I on a
right way?

There's an associated problem with sshd. I edited guest's sshd_config file
to listen on a designated ipv6 address, which is binded to guest with
Daniel's chbind6 only after the guest's started. But sshd could not start up
automatically because there's no ipv6 address assigned yet when guest is
starting up. So I hope the guest starts up with this sequence:
        1. guest started up
        2. Using chbind6 to assign an ipv6 address for it
        3. Start up sshd
I think I could cancel the automatically start of sshd, and put "chbind6"
and "service sshd start" into vserver's initscripts. Are there any other
good ideas?

----------------------------Snip----------------------------------------
#vserver gast start
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
Starting sshd: [ OK ]
Starting xinetd: [ OK ]
Starting crond: [ OK ]

#vserver gast enter
[root@th024045 /]# service sshd status
sshd dead but subsys locked

#vserver gast stop
Stopping sshd: [FAILED]
Stopping xinetd: [ OK ]
Stopping crond: [ OK ]
Shutting down kernel logger: [FAILED]
Shutting down system logger: [ OK ]
Starting killall: Stopping sshd: [FAILED]
                                                           [FAILED]
-------------------------snap---------------------------------------

Best regards!

_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Mon Jun 12 05:34:27 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 12 Jun 2006 - 05:34:32 BST by hypermail 2.1.8