Forum Discussion

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

Saving IP configuration through haserl script on website

Hi, I was trying to change the ip address of my board through the website. So I followed the article on http://www.alterawiki.com/wiki/using_haserl_scripts_for_html_based_runtime_configuration_and_monitoring . But I always get the following message:

hush: can't open 'mnt/config/rc1': Permission denied

when commiting the new ip address on the config.has script.

During the initilization process the config rc1 was successfully read. But I don't understand why it can't be opened from the website.

Urmel

4 Replies

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

    Usually boa runs the http requests as a dedicated user. Of course you need to grant this user permissions to the files you want to have changed via the web interface.

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

    Hi Michael,

    under my linux desktop I changed the rights of the file 'rc1' to user 'root' and group 'root'.

    Then I copied the file through ftp to the directory '/mnt/config' on the flash filesystem.

    This is the permission of the file on the board:

    -rw-r-----    1 root     root          129 Nov 29 16:01 rc1
    I don't know why the execution bit is not set anymore.

    In the configuration file from boa the user and group is also set to 'root'.

    The file is executed on the 'config_commit.has' site through the file 'rc1s' which output is

    RC=/mnt/config/rc1
    echo HOSTNAME=$HOSTNAME > $RC
    echo DHCP=$DHCP >> $RC
    echo IP=$IP >> $RC
    echo BOA=$BOA >> $RC
    echo DEMO=$DEMO >> $RC
    echo DEMOPIC=$DEMOPIC >> $RC
    Urmel
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    AFAIK, ftp does not set file mode bits (scp does).

    AFAIR, the file mode bits need to be set explicitly in the distribution make script to be "persistent".

    Of course alternatively you can do a chmod in an rc script to set the file mode in realtime when the device starts .

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

    Hi Michael,

    thanks for the help!

    I made chmod 777 on the rc1 script file during booting and now it works. So it was due to a missing execution bit.

    Urmel