Loading ...
Sorry, an error occurred while loading the content.

Help with Init Script

Expand Messages
  • daviseh
    I am trying to create a startup script to run Slimserver on the Kurobox. I have slimserver installed and running mnt/slimserver/slimserver.pl . I have done a
    Message 1 of 9 , Apr 9 9:36 PM
    • 0 Attachment
      I am trying to create a startup script to run Slimserver on the
      Kurobox.

      I have slimserver installed and
      running "mnt/slimserver/slimserver.pl". I have done a lot of
      searches but have not been able to make this work. I found the
      following script here and tried to modify it to fit my setup but I
      can not get this to work on bootup.

      Any help would be greatly appreciated.

      Thanks.

      #!/bin/bash
      #
      # slimserver.init This shell script takes care of starting and
      stopping
      # the Slim streaming MP3 server.
      #
      # chkconfig: 2345 80 30
      # description: Slim streaming MP3 server
      # processname: slimserver.pl
      # config: /mnt/slim-data/slimserver.conf

      # Return Value variable (0 is normal completion)
      RETVAL=0

      # Name of the slimserver executable
      SLIMSERVER_PROC="slimserver.pl"

      # Directory where the slimserver executable is found
      SLIMSERVER_HOME="/mnt/slimserver"

      # Directory and name of slimserver config file (will be created if
      not found)
      SLIMSERVER_CFG="/mnt/slim-data/slimserver.conf"

      # Directory and name of slimserver log file (will be created by
      slimserver)
      SLIMSERVER_LOG="/tmp/slimserver.log"

      # Start slimserver as daemon (its own process) and specify config
      and log files
      SLIMSERVER_ARGS="--daemon --prefsfile=$SLIMSERVER_CFG --
      logfile=$SLIMSERVER_LOG"

      # Complete path to slimserver executable
      SLIMSERVER_BIN="$SLIMSERVER_HOME/$SLIMSERVER_PROC"

      #
      # Start SlimServer
      #
      start() {
      echo -n "Starting SlimServer: "
      $SLIMSERVER_BIN $SLIMSERVER_ARGS
      RETVAL=$?
      echo
      return $RETVAL
      }

      #
      # Stop SlimServer
      #
      stop() {
      echo -n "Shutting down SlimServer: "
      killall -9 $SLIMSERVER_PROC
      RETVAL=$?
      echo
      return $RETVAL
      }

      # See how we were called.
      case "$1" in
      start)
      start
      RETVAL=$?
      ;;
      stop)
      stop
      RETVAL=$?
      ;;
      restart|reload)
      stop
      start
      RETVAL=$?
      ;;
      *)
      echo "Usage: $0 {start|stop|restart|reload}"
      exit 1
      esac

      exit $RETVAL
    • lalunas10
      ... I ll assume the script is called slimserver . The script looks good as such; you ll have to chmod 0755 /etc/init.d/slimserver . If / etc/
      Message 2 of 9 , Apr 10 3:44 AM
      • 0 Attachment
        --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@...>
        wrote:
        >
        > I am trying to create a startup script to run Slimserver on the
        > Kurobox.
        >
        > I have slimserver installed and
        > running "mnt/slimserver/slimserver.pl". I have done a lot of
        > searches but have not been able to make this work. I found the
        > following script here and tried to modify it to fit my setup but I
        > can not get this to work on bootup.

        I'll assume the script is called "slimserver". The script looks good as
        such; you'll have to "chmod 0755 /etc/init.d/slimserver". If /"etc/
        init.d/slimserver start" works, create a symbolic link to it in the
        right place, either /etc/rc.d/rc2.d/slimserver or /etc/rc2.d/
        slimserver.

        -Andre
      • daviseh
        ... I ... good as ... Andre - Thanks for your resposne. The script is slimstart.sh. I enter /etc/init.d/slimstart.sh start and slimserver starts. I check ps
        Message 3 of 9 , Apr 10 8:22 AM
        • 0 Attachment
          --- In LinkStation_General@yahoogroups.com, "lalunas10"
          <lalunas10@...> wrote:
          >
          > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
          > wrote:
          > >
          > > I am trying to create a startup script to run Slimserver on the
          > > Kurobox.
          > >
          > > I have slimserver installed and
          > > running "mnt/slimserver/slimserver.pl". I have done a lot of
          > > searches but have not been able to make this work. I found the
          > > following script here and tried to modify it to fit my setup but
          I
          > > can not get this to work on bootup.
          >
          > I'll assume the script is called "slimserver". The script looks
          good as
          > such; you'll have to "chmod 0755 /etc/init.d/slimserver". If /"etc/
          > init.d/slimserver start" works, create a symbolic link to it in the
          > right place, either /etc/rc.d/rc2.d/slimserver or /etc/rc2.d/
          > slimserver.
          >
          > -Andre
          >

          Andre - Thanks for your resposne.

          The script is slimstart.sh. I enter "/etc/init.d/slimstart.sh start"
          and slimserver starts. I check ps -A and it shows slimserver.pl.

          I created a soft link in "/etc/rc.d/rc2.d/slimstart.sh" but the
          script does not run at bootup. I checked ps -A and no slimserver.

          What am I doing wrong?

          Ed
        • lalunas10
          ... If / etc/ ... the ... The script may not run due to security restrictions if your perl is in /usr/local/bin/. -Andre
          Message 4 of 9 , Apr 10 8:31 AM
          • 0 Attachment
            --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@...>
            wrote:
            >
            > --- In LinkStation_General@yahoogroups.com, "lalunas10"
            > <lalunas10@> wrote:
            > >
            > > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
            > > wrote:
            > > >
            > > > I am trying to create a startup script to run Slimserver on the
            > > > Kurobox.
            > > >
            > > > I have slimserver installed and
            > > > running "mnt/slimserver/slimserver.pl". I have done a lot of
            > > > searches but have not been able to make this work. I found the
            > > > following script here and tried to modify it to fit my setup but
            > I
            > > > can not get this to work on bootup.
            > >
            > > I'll assume the script is called "slimserver". The script looks
            > good as
            > > such; you'll have to "chmod 0755 /etc/init.d/slimserver".
            If /"etc/
            > > init.d/slimserver start" works, create a symbolic link to it in
            the
            > > right place, either /etc/rc.d/rc2.d/slimserver or /etc/rc2.d/
            > > slimserver.
            > >
            > > -Andre
            > >
            >
            > Andre - Thanks for your resposne.
            >
            > The script is slimstart.sh. I enter "/etc/init.d/slimstart.sh start"
            > and slimserver starts. I check ps -A and it shows slimserver.pl.
            >
            > I created a soft link in "/etc/rc.d/rc2.d/slimstart.sh" but the
            > script does not run at bootup. I checked ps -A and no slimserver.
            >
            > What am I doing wrong?

            The script may not run due to security restrictions if your perl is in
            /usr/local/bin/.

            -Andre
          • lalunas10
            ... the ... but ... start ... in ... Also, and more probable, is the startup timing is wrong. Rename your softlink to /etc/rc.d/rc2.d/S90slimstart.sh -Andre
            Message 5 of 9 , Apr 10 8:36 AM
            • 0 Attachment
              --- In LinkStation_General@yahoogroups.com, "lalunas10"
              <lalunas10@...> wrote:
              >
              > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
              > wrote:
              > >
              > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
              > > <lalunas10@> wrote:
              > > >
              > > > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
              > > > wrote:
              > > > >
              > > > > I am trying to create a startup script to run Slimserver on
              the
              > > > > Kurobox.
              > > > >
              > > > > I have slimserver installed and
              > > > > running "mnt/slimserver/slimserver.pl". I have done a lot of
              > > > > searches but have not been able to make this work. I found the
              > > > > following script here and tried to modify it to fit my setup
              but
              > > I
              > > > > can not get this to work on bootup.
              > > >
              > > > I'll assume the script is called "slimserver". The script looks
              > > good as
              > > > such; you'll have to "chmod 0755 /etc/init.d/slimserver".
              > If /"etc/
              > > > init.d/slimserver start" works, create a symbolic link to it in
              > the
              > > > right place, either /etc/rc.d/rc2.d/slimserver or /etc/rc2.d/
              > > > slimserver.
              > > >
              > > > -Andre
              > > >
              > >
              > > Andre - Thanks for your resposne.
              > >
              > > The script is slimstart.sh. I enter "/etc/init.d/slimstart.sh
              start"
              > > and slimserver starts. I check ps -A and it shows slimserver.pl.
              > >
              > > I created a soft link in "/etc/rc.d/rc2.d/slimstart.sh" but the
              > > script does not run at bootup. I checked ps -A and no slimserver.
              > >
              > > What am I doing wrong?
              >
              > The script may not run due to security restrictions if your perl is
              in
              > /usr/local/bin/.

              Also, and more probable, is the startup timing is wrong. Rename your
              softlink to "/etc/rc.d/rc2.d/S90slimstart.sh"

              -Andre
            • daviseh
              ... in ... Andre - I am really in over my head. I don t know what the perl files look like but I don t see anything like that in /usr/local/bin/. Just vlc,
              Message 6 of 9 , Apr 10 8:47 AM
              • 0 Attachment
                > The script may not run due to security restrictions if your perl is
                in
                > /usr/local/bin/.
                >
                > -Andre

                Andre - I am really in over my head. I don't know what the perl files
                look like but I don't see anything like that in /usr/local/bin/. Just
                vlc, bison, xml, etc. However, I do see a symbolic link
                to "slimstart".

                Is there a way to get around this?

                I saw something about creating a USER named slimserver in one of the
                instructions but it was a more elaborate script. Does this give
                access and get around the security issue?

                Thanks,

                Ed
              • daviseh
                ... ... of ... the ... setup ... looks ... in ... slimserver. ... is ... your ... Sorry to bother you again but I think I have done something that
                Message 7 of 9 , Apr 10 11:13 AM
                • 0 Attachment
                  --- In LinkStation_General@yahoogroups.com, "lalunas10"
                  <lalunas10@...> wrote:
                  >
                  > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                  > <lalunas10@> wrote:
                  > >
                  > > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
                  > > wrote:
                  > > >
                  > > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                  > > > <lalunas10@> wrote:
                  > > > >
                  > > > > --- In LinkStation_General@yahoogroups.com, "daviseh"
                  <daviseh@>
                  > > > > wrote:
                  > > > > >
                  > > > > > I am trying to create a startup script to run Slimserver on
                  > the
                  > > > > > Kurobox.
                  > > > > >
                  > > > > > I have slimserver installed and
                  > > > > > running "mnt/slimserver/slimserver.pl". I have done a lot
                  of
                  > > > > > searches but have not been able to make this work. I found
                  the
                  > > > > > following script here and tried to modify it to fit my
                  setup
                  > but
                  > > > I
                  > > > > > can not get this to work on bootup.
                  > > > >
                  > > > > I'll assume the script is called "slimserver". The script
                  looks
                  > > > good as
                  > > > > such; you'll have to "chmod 0755 /etc/init.d/slimserver".
                  > > If /"etc/
                  > > > > init.d/slimserver start" works, create a symbolic link to it
                  in
                  > > the
                  > > > > right place, either /etc/rc.d/rc2.d/slimserver or /etc/rc2.d/
                  > > > > slimserver.
                  > > > >
                  > > > > -Andre
                  > > > >
                  > > >
                  > > > Andre - Thanks for your resposne.
                  > > >
                  > > > The script is slimstart.sh. I enter "/etc/init.d/slimstart.sh
                  > start"
                  > > > and slimserver starts. I check ps -A and it shows slimserver.pl.
                  > > >
                  > > > I created a soft link in "/etc/rc.d/rc2.d/slimstart.sh" but the
                  > > > script does not run at bootup. I checked ps -A and no
                  slimserver.
                  > > >
                  > > > What am I doing wrong?
                  > >
                  > > The script may not run due to security restrictions if your perl
                  is
                  > in
                  > > /usr/local/bin/.
                  >
                  > Also, and more probable, is the startup timing is wrong. Rename
                  your
                  > softlink to "/etc/rc.d/rc2.d/S90slimstart.sh"
                  >
                  > -Andre
                  >
                  Sorry to bother you again but I think I have done something that is
                  preventing me from creating a symbolic link. The link does not appear
                  in the folder but when I try to create it again, it says that the
                  file already exists.

                  I went into the folder and deleted the link before I read you note to
                  rename it.

                  Have I corrupted my instalion?

                  Ed
                • lalunas10
                  ... on ... rc2.d/ ... slimserver.pl. ... the ... appear ... to ... No, it wasn t there before ;) You should be able to copy&paste the following into your
                  Message 8 of 9 , Apr 10 11:50 PM
                  • 0 Attachment
                    --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@...>
                    wrote:
                    >
                    > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                    > <lalunas10@> wrote:
                    > >
                    > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                    > > <lalunas10@> wrote:
                    > > >
                    > > > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
                    > > > wrote:
                    > > > >
                    > > > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                    > > > > <lalunas10@> wrote:
                    > > > > >
                    > > > > > --- In LinkStation_General@yahoogroups.com, "daviseh"
                    > <daviseh@>
                    > > > > > wrote:
                    > > > > > >
                    > > > > > > I am trying to create a startup script to run Slimserver
                    on
                    > > the
                    > > > > > > Kurobox.
                    > > > > > >
                    > > > > > > I have slimserver installed and
                    > > > > > > running "mnt/slimserver/slimserver.pl". I have done a lot
                    > of
                    > > > > > > searches but have not been able to make this work. I found
                    > the
                    > > > > > > following script here and tried to modify it to fit my
                    > setup
                    > > but
                    > > > > I
                    > > > > > > can not get this to work on bootup.
                    > > > > >
                    > > > > > I'll assume the script is called "slimserver". The script
                    > looks
                    > > > > good as
                    > > > > > such; you'll have to "chmod 0755 /etc/init.d/slimserver".
                    > > > If /"etc/
                    > > > > > init.d/slimserver start" works, create a symbolic link to it
                    > in
                    > > > the
                    > > > > > right place, either /etc/rc.d/rc2.d/slimserver or /etc/
                    rc2.d/
                    > > > > > slimserver.
                    > > > > >
                    > > > > > -Andre
                    > > > > >
                    > > > >
                    > > > > Andre - Thanks for your resposne.
                    > > > >
                    > > > > The script is slimstart.sh. I enter "/etc/init.d/slimstart.sh
                    > > start"
                    > > > > and slimserver starts. I check ps -A and it shows
                    slimserver.pl.
                    > > > >
                    > > > > I created a soft link in "/etc/rc.d/rc2.d/slimstart.sh" but
                    the
                    > > > > script does not run at bootup. I checked ps -A and no
                    > slimserver.
                    > > > >
                    > > > > What am I doing wrong?
                    > > >
                    > > > The script may not run due to security restrictions if your perl
                    > is
                    > > in
                    > > > /usr/local/bin/.
                    > >
                    > > Also, and more probable, is the startup timing is wrong. Rename
                    > your
                    > > softlink to "/etc/rc.d/rc2.d/S90slimstart.sh"
                    > >
                    > > -Andre
                    > >
                    > Sorry to bother you again but I think I have done something that is
                    > preventing me from creating a symbolic link. The link does not
                    appear
                    > in the folder but when I try to create it again, it says that the
                    > file already exists.
                    >
                    > I went into the folder and deleted the link before I read you note
                    to
                    > rename it.
                    >
                    > Have I corrupted my instalion?

                    No, it wasn't there before ;)

                    You should be able to copy&paste the following into your terminal as a
                    block:


                    cd /etc/rc.d/rc2.d/
                    rm slimstart* 2>/dev/null
                    ln -s ../../init.d/slimstart.sh S90slimstart.sh
                    cd /etc/rc.d/rc5.d/
                    ln -s ../../init.d/slimstart.sh K90slimstart.sh
                    cd /etc/rc.d/rc6.d/
                    ln -s ../../init.d/slimstart.sh K90slimstart.sh


                    and would have all links created cleanly that way.

                    -Andre
                  • daviseh
                    ... ... Slimserver ... lot ... found ... script ... 0755 /etc/init.d/slimserver . ... to it ... enter /etc/init.d/slimstart.sh ... but ... perl ...
                    Message 9 of 9 , Apr 11 4:58 AM
                    • 0 Attachment
                      --- In LinkStation_General@yahoogroups.com, "lalunas10"
                      <lalunas10@...> wrote:
                      >
                      > --- In LinkStation_General@yahoogroups.com, "daviseh" <daviseh@>
                      > wrote:
                      > >
                      > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                      > > <lalunas10@> wrote:
                      > > >
                      > > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                      > > > <lalunas10@> wrote:
                      > > > >
                      > > > > --- In LinkStation_General@yahoogroups.com, "daviseh"
                      <daviseh@>
                      > > > > wrote:
                      > > > > >
                      > > > > > --- In LinkStation_General@yahoogroups.com, "lalunas10"
                      > > > > > <lalunas10@> wrote:
                      > > > > > >
                      > > > > > > --- In LinkStation_General@yahoogroups.com, "daviseh"
                      > > <daviseh@>
                      > > > > > > wrote:
                      > > > > > > >
                      > > > > > > > I am trying to create a startup script to run
                      Slimserver
                      > on
                      > > > the
                      > > > > > > > Kurobox.
                      > > > > > > >
                      > > > > > > > I have slimserver installed and
                      > > > > > > > running "mnt/slimserver/slimserver.pl". I have done a
                      lot
                      > > of
                      > > > > > > > searches but have not been able to make this work. I
                      found
                      > > the
                      > > > > > > > following script here and tried to modify it to fit my
                      > > setup
                      > > > but
                      > > > > > I
                      > > > > > > > can not get this to work on bootup.
                      > > > > > >
                      > > > > > > I'll assume the script is called "slimserver". The
                      script
                      > > looks
                      > > > > > good as
                      > > > > > > such; you'll have to "chmod
                      0755 /etc/init.d/slimserver".
                      > > > > If /"etc/
                      > > > > > > init.d/slimserver start" works, create a symbolic link
                      to it
                      > > in
                      > > > > the
                      > > > > > > right place, either /etc/rc.d/rc2.d/slimserver or /etc/
                      > rc2.d/
                      > > > > > > slimserver.
                      > > > > > >
                      > > > > > > -Andre
                      > > > > > >
                      > > > > >
                      > > > > > Andre - Thanks for your resposne.
                      > > > > >
                      > > > > > The script is slimstart.sh. I
                      enter "/etc/init.d/slimstart.sh
                      > > > start"
                      > > > > > and slimserver starts. I check ps -A and it shows
                      > slimserver.pl.
                      > > > > >
                      > > > > > I created a soft link in "/etc/rc.d/rc2.d/slimstart.sh"
                      but
                      > the
                      > > > > > script does not run at bootup. I checked ps -A and no
                      > > slimserver.
                      > > > > >
                      > > > > > What am I doing wrong?
                      > > > >
                      > > > > The script may not run due to security restrictions if your
                      perl
                      > > is
                      > > > in
                      > > > > /usr/local/bin/.
                      > > >
                      > > > Also, and more probable, is the startup timing is wrong.
                      Rename
                      > > your
                      > > > softlink to "/etc/rc.d/rc2.d/S90slimstart.sh"
                      > > >
                      > > > -Andre
                      > > >
                      > > Sorry to bother you again but I think I have done something that
                      is
                      > > preventing me from creating a symbolic link. The link does not
                      > appear
                      > > in the folder but when I try to create it again, it says that
                      the
                      > > file already exists.
                      > >
                      > > I went into the folder and deleted the link before I read you
                      note
                      > to
                      > > rename it.
                      > >
                      > > Have I corrupted my instalion?
                      >
                      > No, it wasn't there before ;)
                      >
                      > You should be able to copy&paste the following into your terminal
                      as a
                      > block:
                      >
                      >
                      > cd /etc/rc.d/rc2.d/
                      > rm slimstart* 2>/dev/null
                      > ln -s ../../init.d/slimstart.sh S90slimstart.sh
                      > cd /etc/rc.d/rc5.d/
                      > ln -s ../../init.d/slimstart.sh K90slimstart.sh
                      > cd /etc/rc.d/rc6.d/
                      > ln -s ../../init.d/slimstart.sh K90slimstart.sh
                      >
                      >
                      > and would have all links created cleanly that way.
                      >
                      > -Andre

                      Thanks Andre,

                      Slimserver is now running at bootup.

                      Ed
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.