element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Forum Run at boot time
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 5 replies
  • Answers 3 answers
  • Subscribers 103 subscribers
  • Views 986 views
  • Users 0 members are here
Related

Run at boot time

angellxp
angellxp over 6 years ago

I'm having some trouble getting my Ethernet port to stay static.  I have edited the /esc/network/interfaces file to have the correct info and when I do an ifdown then ifup eth0 everything is all fine.

 

I had written a script that was supposed to do this at boot along with starting the VNC server but it does not seem to be executing @ boot but it I run it independently it works fine.

  • Sign in to reply
  • Cancel

Top Replies

  • cstanton
    cstanton over 6 years ago +2 suggested
    > I'm having some trouble getting my Ethernet port to stay static There's actually two ways to approach this. One is to edit the configuration of your DHCP server to setup a 'reservation' for the IP address…
  • Gough Lui
    Gough Lui over 6 years ago +1 suggested
    I'm not sure why that is happening but I had similar issues with a script running @reboot in /etc/crontab that didn't seem to work and adding a delay to the beginning of the script helped. It could be…
  • Gough Lui
    Gough Lui over 6 years ago in reply to angellxp +1
    The other thing is that if you find /etc/network/interfaces method not to work, you should probably revert it to the original one as your interface may be configured with dhcpcd and you will instead need…
  • Gough Lui
    0 Gough Lui over 6 years ago

    I'm not sure why that is happening but I had similar issues with a script running @reboot in /etc/crontab that didn't seem to work and adding a delay to the beginning of the script helped. It could be because the Ethernet interface had not been enumerated or come up with a proper address by the time you are trying to start the VNC server that is causing the issue. Sprinkle a few delays in the script to ensure the start-up has been completed and it might work. Other times it could be because of differences in user privileges in how the script is run.

     

    - Gough

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • cstanton
    0 cstanton over 6 years ago

    > I'm having some trouble getting my Ethernet port to stay static

     

    There's actually two ways to approach this.

     

    One is to edit the configuration of your DHCP server to setup a 'reservation' for the IP address for your device, so that when it asks for an IP address, it's always given the same details. This is typically the 'best' way to do it.

     

    The alternative is to edit the network configuration as you're doing, and Debian has documentation on this https://wiki.debian.org/NetworkConfiguration - you shouldn't need to have a script running on startup to set this in place, and unless you're using a package such as 'NetworkManager' that alters or reconfigures the interface it shouldn't really change.

     

    There are many different ways to run a script at boot time, and this has become confusing with the introduction of System-V:

     

    https://wiki.debian.org/BootProcess

    https://wiki.debian.org/LSBInitScripts

    https://debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian

     

    And also it depends at what point in the boot you want the script to run

     

    https://wiki.debian.org/CategoryBootProcess

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • angellxp
    0 angellxp over 6 years ago in reply to cstanton

    Thanks for all the helpful links.  Ill try them out in the next day or two. 

     

    I'd prefer the script to run later in the boot process so that the other boot up functions don't override it.

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Gough Lui
    0 Gough Lui over 6 years ago in reply to angellxp

    The other thing is that if you find /etc/network/interfaces method not to work, you should probably revert it to the original one as your interface may be configured with dhcpcd and you will instead need to edit /etc/dhcpcd.conf instead. I know the Raspberry Pi has moved to this ever since the move to systemd

     

    - Gough

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jomoenginer
    0 jomoenginer over 6 years ago in reply to angellxp

    Putting something in the crontab to run at start-up is not the right place to do this.  You should consider using /etc/rc.local before exit 0 or create a startup script in something like /etc/rc4.d.  With the newer Debian images for the BBB, connmanctl is used for WiFi config instead of the old way with /etc/network/interfaces.  This is spelled out in the interfaces file.

    ##connman: WiFi
    #
    #connmanctl
    #connmanctl> tether wifi off
    #connmanctl> enable wifi
    #connmanctl> scan wifi
    #connmanctl> services
    #connmanctl> agent on
    #connmanctl> connect wifi_*_managed_psk
    #connmanctl> quit

     

    You may still run into an issue with permissions in which case you may have to look at adding the user to sudoers.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube