Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

shell command to run on startup

Featured Replies

I need to run a few commands on the terminal as root every time the system starts up to load the integrated graphics driver for plex hardware transcoding. The commands are pretty simple, just:

modprobe i915
chown -R nobody:users /dev/dri
chmod -R 777 /dev/dri

In the past (distant) I've achieved that by putting something in /etc/init.d however with Unraid, that doesn't exist and besides probably wouldn't work as the file system is loaded from the USB.

 

So what's the best-practice way to achieve this in Unraid. Ideally I'd like not to have to re-do this every time I update Unraid.

 

Thanks in advance.

9 minutes ago, dgwharrison said:

I need to run a few commands on the terminal as root every time the system starts up to load the integrated graphics driver for plex hardware transcoding. The commands are pretty simple, just:


modprobe i915
chown -R nobody:users /dev/dri
chmod -R 777 /dev/dri

In the past (distant) I've achieved that by putting something in /etc/init.d however with Unraid, that doesn't exist and besides probably wouldn't work as the file system is loaded from the USB.

 

So what's the best-practice way to achieve this in Unraid. Ideally I'd like not to have to re-do this every time I update Unraid.

 

Thanks in advance.

Just put them in your go file (or in a script executed by the User Scripts plugin).  That's where you put commands you want executed on boot.  I have the same commands in my go file for Plex HW transcoding.

Edited by Hoopster

Since you want those commands executed before Plex starts up, you want them in the go file (/boot/config/go).  If they didn't have to be executed before Plex then user scripts would be able to handle it (user scripts doesn't execute any commands at array startup until after all services (ie: docker and vms) are started)

8 minutes ago, Squid said:

user scripts doesn't execute any commands at array startup until after all services (ie: docker and vms) are started

Good point.  I forgot about that detail.  👍

Just now, Hoopster said:

Good point.  I forgot about that detail.  👍

And I'm not honouring any feature req's to change that behaviour either :) 

  • Author
5 hours ago, Squid said:

Since you want those commands executed before Plex starts up, you want them in the go file (/boot/config/go).  If they didn't have to be executed before Plex then user scripts would be able to handle it (user scripts doesn't execute any commands at array startup until after all services (ie: docker and vms) are started)

Hi @Squid, thanks for the reply. I tried searching the wiki for a bit of info on the go file but can't find anything. Reason is the file doesn't exist, so do I just create it as root, chmod to 755 and insert my commands in it?

  • Author

disregard... I failed, my ssh session had closed... /boot/config/go does exist and it's 777 modded. 

4 hours ago, dgwharrison said:

disregard... I failed, my ssh session had closed... /boot/config/go does exist and it's 777 modded. 

Keep in mind that the /boot tree is a mount of the FAT32 USB stick, which does NOT allow full linux permissions, etc. If for a future project you need that sort of thing, you will have to work around it by moving things into the root file system and applying what you need there until the array volumes are mounted.

10 hours ago, dgwharrison said:

Hi @Squid, thanks for the reply. I tried searching the wiki for a bit of info on the go file but can't find anything. Reason is the file doesn't exist, so do I just create it as root, chmod to 755 and insert my commands in it?

If you export the flash drive (should be secure or private), it just shows up as a folder you can edit from your PC/Mac/etc.

 

Any time I want to edit the go file, I just open it from the flash share in Windows and modify it with Notepad or Notepad++

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.