# What is the proper way to run something "on boot"?

**URL:** <https://universal-blue.discourse.group/t/what-is-the-proper-way-to-run-something-on-boot/1101>\
**Category:** General\
**Created:** [April 14, 2024, 2:23pm UTC](https://universal-blue.discourse.group/t/what-is-the-proper-way-to-run-something-on-boot/1101 "2024-04-14T14:23:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akarypid](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@akarypid](https://universal-blue.discourse.group/u/akarypid)\
**Post date:** [April 14, 2024, 2:23pm UTC](https://universal-blue.discourse.group/t/what-is-the-proper-way-to-run-something-on-boot/1101/1 "2024-04-14T14:23:02Z")

</div>

Hello,

I’m still trying to come to grips with immutable OS concepts, so best to ask the community.

I have a relatively new laptop model: Yoga Pro 9i 16IMH9 (2024, Intel, Gen 9)

I am affected by this bug:  
[https://bugzilla.kernel.org/show\_bug.cgi?id=217449](https://bugzilla.kernel.org/show_bug.cgi?id=217449)

As a result, to work around this I need to run the [script attached to that bug](https://bugzilla.kernel.org/attachment.cgi?id=304763) on every boot (basically the command `2pa-byps.sh 2` as root at startup).

What is the best way to achieve this in Bluefin?

I literally just found out how to switch between different base images here: [My sylog is spammed by battery threshold failure messages (Yoga Pro 9i - 16IMH9) - SOLVED](https://universal-blue.discourse.group/t/my-sylog-is-spammed-by-battery-threshold-failure-messages-yoga-pro-9i-16imh9-solved/1098)

- Is this something you would define as specific to a base image? Is that even possible?
- I suppose creating a `/etc/systemd/system/myservice.service` file and enabling it run on boot across all images?

I’m just wondering if populating `/etc` with “user stuff” defeats the purpose of using Bluefin? Is there a special location for “user customizations”?

---

<div class="post-metadata">

**Author:** ![stego](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/stego/32/866_2.png) [@stego](https://universal-blue.discourse.group/u/stego)\
**Post date:** [April 14, 2024, 2:31pm UTC](https://universal-blue.discourse.group/t/what-is-the-proper-way-to-run-something-on-boot/1101/2 "2024-04-14T14:31:14Z")

</div>

> [@akarypid](#):
>
> I suppose creating a `/etc/systemd/system/myservice.service` file and enabling it run on boot across all images?

This is the way

> [@akarypid](#):
>
> I’m just wondering if populating `/etc` with “user stuff” defeats the purpose of using Bluefin? Is there a special location for “user customizations”?

It does not defeat the purpose. The place to customize your system on the system-level is `/etc`. By the way: Every time you update to the next image, a snapshot of your current `/etc` is taken, so that when you roll back, your `/etc` also rolls back. And if you really screw up, then you can still restore the current “original” files from `/usr/etc`.

---

<div class="post-metadata">

**Author:** ![akarypid](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@akarypid](https://universal-blue.discourse.group/u/akarypid)\
**Post date:** [April 14, 2024, 3:09pm UTC](https://universal-blue.discourse.group/t/what-is-the-proper-way-to-run-something-on-boot/1101/3 "2024-04-14T15:09:42Z")

</div>

> [@stego](#):
>
> Every time you update to the next image, a snapshot of your current `/etc` is taken, so that when you roll back, your `/etc` also rolls back

This is great. I think I will create a structure in `/root/customization/...` and simply link to it.

For example , this can be: `/root/customization/etc/systemd/system/fix-yoga-speakers.service`

Then I will symlink `/etc/systemd/system/fix-yoga-speakers.service` to point to that file. This way I can have all my stuff in the root user’s home, in one folder.

---

<div class="post-metadata">

**Author:** ![storopoli](https://yyz2.discourse-cdn.com/free1/user_avatar/universal-blue.discourse.group/storopoli/32/1674_2.png) [@storopoli](https://universal-blue.discourse.group/u/storopoli)\
**Post date:** [April 14, 2024, 10:30pm UTC](https://universal-blue.discourse.group/t/what-is-the-proper-way-to-run-something-on-boot/1101/4 "2024-04-14T22:30:56Z")

</div>

> [@stego](#):
>
> By the way: Every time you update to the next image, a snapshot of your current `/etc` is taken, so that when you roll back, your `/etc` also rolls back.

Man thanks. That’s very useful information. I’ve been paranoid taking manual snapshots of my `/etc/` dir.
