• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Linux init.d scripts"

Collapse

  • darmstadt
    replied
    Originally posted by suityou01 View Post
    Did you get this sorted? Let us know.
    End of last week as a matter of fact, need to fully test it but looks like its working. I just did:

    # update-rc.d test-server1 defaults 01 99

    It would be nice to see the messages in the logs but the server starts and stops. Cheers.

    Leave a comment:


  • suityou01
    replied
    Originally posted by suityou01 View Post
    Sorry to state the bleedin obvious but did you make this script runnable?

    chmod 755 /etc/init.d/blah

    type of thing?
    Did you get this sorted? Let us know.

    Leave a comment:


  • suityou01
    replied
    Sorry to state the bleedin obvious but did you make this script runnable?

    chmod 755 /etc/init.d/blah

    type of thing?

    Leave a comment:


  • lilelvis2000
    replied
    sorry -- I run two Ubuntu server and one CentOS - you'd think I'd know that.

    have you tried just:

    update-rc.d test_server1 start 99 3 4 5 . stop 99 0 1 6 .

    Leave a comment:


  • darmstadt
    replied
    Originally posted by lilelvis2000 View Post
    Is the chkconfig line in the top of the script. I think that needs to be there it won't get run.
    No chkconfig in Debian I'm afraid.

    Leave a comment:


  • lilelvis2000
    replied
    Is the chkconfig line in the top of the script. I think that needs to be there it won't get run.

    Leave a comment:


  • darmstadt
    started a topic Linux init.d scripts

    Linux init.d scripts

    In order to stop and start applications automatically on Debian I created a script based on the skeleton in /etc/init.d and then ran the update-rc.d command on it:

    update-rc.d test_server1 start 99 3 . stop 01 0 6

    This created the relevant links in /etc/rc3.d to start it and in /etc/rc0.d and rc6.d to stop it. The problem seems to be that at system boot time it doesn't seem to run the script but at system shutdown it does. You can run the script manually but need to provide a parameter (start/stop/restart/status) so I know it is working and as can be seen, the shutdown is fine. I'm just wondering as to why the start is not being picked up.

    The only differences between the stop and start is that start uses the start-stop-daemon, i.e.


    start-stop-daemon --start --pidfile $PIDFILE --startas $DAEMONSTA $NAME --test > /dev/null \
    || return 1
    start-stop-daemon --start --pidfile $PIDFILE --startas $DAEMONSTA $NAME -- \
    || return 2


    whereas stopping it uses commands sent to the server as start-stop-daemon justs gets the pid and then kills the process but I want it to stop cleanly, i.e.

    $DAEMONSTO $NAME -user adminuser -password password

    The restart just calls the above 2 steps and works fine. Just wondering if I missed something somewhere...TIA.
Working...
X