# Run script at beagle bone start

**URL:** <https://forums.balena.io/t/run-script-at-beagle-bone-start/690>\
**Category:** Product support\
**Created:** [March 22, 2017, 6:05pm UTC](https://forums.balena.io/t/run-script-at-beagle-bone-start/690 "2017-03-22T18:05:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![galminana](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@galminana](https://forums.balena.io/u/galminana)\
**Post date:** [March 22, 2017, 6:05pm UTC](https://forums.balena.io/t/run-script-at-beagle-bone-start/690/1 "2017-03-22T18:05:51Z")

</div>

Hi, i am tying to run an script on the start, i have put my code on rc.local but doesnt work, where i need to put it?

Thanks!

---

<div class="post-metadata">

**Author:** ![CameronDiver](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@CameronDiver](https://forums.balena.io/u/CameronDiver)\
**Post date:** [March 22, 2017, 6:07pm UTC](https://forums.balena.io/t/run-script-at-beagle-bone-start/690/2 "2017-03-22T18:07:56Z")

</div>

Hey @galminana you should be able to add it to your `CMD` line in your Dockerfile to run a program/script on container start.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [March 22, 2017, 6:55pm UTC](https://forums.balena.io/t/run-script-at-beagle-bone-start/690/3 "2017-03-22T18:55:41Z")

</div>

Besides using a script, you can also try enabling systemd (if you are on Debian), and starting your script as a systemd service file:

> **[Understanding Systemd Units and Unit Files | DigitalOcean](https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files)**
>
> Increasingly, Linux distributions are adopting or planning to adopt the systemd init system. This powerful suite of software can manage many aspects of your server, from services to mounted devices and system states. In systemd, a unit refers to any...

This project shows both how to do a start script (called `start.sh`, for example) and a systemd service.

> **[balena-io-playground/balena-bbgw-bluetooth](https://github.com/balena-io-playground/balena-bbgw-bluetooth)**
>
> Enabled Bluetooth on BeagleBone Green Wireless (basic example project for Debian) - balena-io-playground/balena-bbgw-bluetooth

Does this help? 🙂
