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

running on boot

Expand Messages
  • David Powell
    I thought I knew how to make a program run automatically on boot, but for some reason I just can t get it to work on the slug. I m running slugOS/BE and I
    Message 1 of 3 , Aug 8, 2009
      I thought I knew how to make a program run automatically on boot, but
      for some reason I just can't get it to work on the slug. I'm running
      slugOS/BE and I created a shell script that I want to run when the slug
      boots. It's a very simple script, just starts a Java program and puts it
      to the background. I created the script in the /etc/init.d/ directory,
      and put a softlink to it in the /etc/rcS.d/ directory. The softlink is
      called S98solarServer. I can execute the softlink from the command line
      and it runs fine, but when I reboot it doesn't run. What am I doing wrong?
      Thanks, David
    • Mike Westerhof (mwester)
      ... Any of about a million things can be wrong; we need a bit more debugging. Can you post your shell script, please? Also, what are the permissions on it
      Message 2 of 3 , Aug 8, 2009
        David Powell wrote:
        > I thought I knew how to make a program run automatically on boot, but
        > for some reason I just can't get it to work on the slug. I'm running
        > slugOS/BE and I created a shell script that I want to run when the slug
        > boots. It's a very simple script, just starts a Java program and puts it
        > to the background. I created the script in the /etc/init.d/ directory,
        > and put a softlink to it in the /etc/rcS.d/ directory. The softlink is
        > called S98solarServer. I can execute the softlink from the command line
        > and it runs fine, but when I reboot it doesn't run. What am I doing wrong?
        > Thanks, David

        Any of about a million things can be wrong; we need a bit more debugging.

        Can you post your shell script, please? Also, what are the permissions
        on it (the output from "ls -l /etc/init.d/S98solarServer" would do)? If
        you add "echo solarServer >> /var/tmp/solarServer.log" as the first
        executable statement in your script, does that log file get created
        correctly?

        Mike (mwester)
      • david90210david
        I tried what you said, that s a great idea. The log file does get written, so it must be executing the script. What the script actually does is run another
        Message 3 of 3 , Aug 9, 2009
          I tried what you said, that's a great idea. The log file does get written, so it must be executing the script.

          What the script actually does is run another script. I put the same sort of test in that one and it is being run as well.

          So I guess the thing that's not happening is my java program. I could put a debug statement in it too, so I'll try that. In the meantime, here's the dir listing and contents of the 2nd script:

          root@solar:~# ls -l /server.sh
          -rwxrw-rw- 1 root root 633 Aug 9 18:04 /server.sh
          root@solar:~# cat /server.sh
          #!/bin/bash

          stty -F /dev/ttyUSB0 -parenb -parodd cs8 -hupcl -cstopb cread clocal crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
          cd /usr/src/javaprogs/
          jamvm -cp .:/opt/lib/java/RXTXcomm.jar:/opt/lib/jcckit.jar -Dgnu.classpath.boot.library.path=/opt/lib/classpath/ -Djava.library.path=/opt/lib/classpath:/opt/lib org.buteomont.solar.Server


          Thanks, David

          --- In nslu2-linux@yahoogroups.com, "Mike Westerhof (mwester)" <mwester@...> wrote:
          >
          >
          >
          > David Powell wrote:
          > > I thought I knew how to make a program run automatically on boot, but
          > > for some reason I just can't get it to work on the slug. I'm running
          > > slugOS/BE and I created a shell script that I want to run when the slug
          > > boots. It's a very simple script, just starts a Java program and puts it
          > > to the background. I created the script in the /etc/init.d/ directory,
          > > and put a softlink to it in the /etc/rcS.d/ directory. The softlink is
          > > called S98solarServer. I can execute the softlink from the command line
          > > and it runs fine, but when I reboot it doesn't run. What am I doing wrong?
          > > Thanks, David
          >
          > Any of about a million things can be wrong; we need a bit more debugging.
          >
          > Can you post your shell script, please? Also, what are the permissions
          > on it (the output from "ls -l /etc/init.d/S98solarServer" would do)? If
          > you add "echo solarServer >> /var/tmp/solarServer.log" as the first
          > executable statement in your script, does that log file get created
          > correctly?
          >
          > Mike (mwester)
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.