Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Execute reboot script with haserl

Hi, I am using haserl for cgi programming and want to reboot my uClinux board through pushing a button on a website. So I thought that I can execute the reboot script like that:

#!/usr/bin/haserl --shell=/bin/hush
Content-type: text/html
<!--
<% if ; then %>
<% /bin/reboot %>
<% fi %>
-->
...
<tr><td colspan="3" class="OptionLabel"><center><input name="Reboot" value="Reboot Now" type="submit">
...

But nothing seems to happen.

Urmel

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Wild guess:

    Haserl is running as some HTTP user and same has no right to force the reboot.

    Of course you should send a web page saying "Booting..." to the browser, when the commant is detected, so you know whether the rebooot command it reached at all.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks Michael, you guessed right. :)

    It was again a problem with the rights of the file.

    So I changed it to root and now it works fine!