How to Startup With Commands? [SOLVED]

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
Noob193
Level 1
Level 1
Posts: 3
Joined: Wed Feb 11, 2026 9:22 pm

How to Startup With Commands? [SOLVED]

Post by Noob193 »

Hello! I did a previous search (viewtopic.php?t=440295) but the proposed solution(s)* didn't work.

I'm trying to boot with powerlimits on my graphics cards but nothing I've tried including rc.local and the startup applications ui have worked so any help would be appreciated.

Here is the info that was generated by the UI (set as 'add custom command')

[Desktop Entry]
Type=Application
Exec=/home/apple/gpupowerlimit.sh
NoDisplay=false
Name[en_US]=/home/apple/gpupowerlimit.sh
X-GNOME-Autostart-Delay=15

And the actual gpupowerlimit.sh code:

Code: Select all

#!/bin/bash

sudo nvidia-smi -i 0 -pl 400

sudo nvidia-smi -i 1,2 -pl 250

exit 0
I feel like I'm missing something really simple here :oops: , thanks for your patience!

Edit: Forgot to add that this is a fresh install of Cinnamon 6.6.7 with kernel 6.17.0-14-generic.
Last edited by Noob193 on Thu Feb 12, 2026 12:52 am, edited 2 times in total.
User avatar
WristWidget
Level 6
Level 6
Posts: 1392
Joined: Wed Sep 25, 2024 11:12 pm

Re: How to Startup With Commands?

Post by WristWidget »

Noob193 wrote: Wed Feb 11, 2026 9:35 pm Hello! I did a previous search (viewtopic.php?t=440295) but the proposed solution didn't work.
Hold up, that thread gives three different options. Define "the proposed solution didn't work."
Noob193
Level 1
Level 1
Posts: 3
Joined: Wed Feb 11, 2026 9:22 pm

Re: How to Startup With Commands?

Post by Noob193 »

Sorry if I wasn't clear, but both the local.rc solution (I made one with sudo nano but kept getting 'file not detected' errors, even when using a hardlink to /home/apple/gpupowerlimit.sh or moving the file to the /etc/ folder + logging in as user thinking it was a PATH issue) and using the simpler "Startup Applications" ui
User avatar
WristWidget
Level 6
Level 6
Posts: 1392
Joined: Wed Sep 25, 2024 11:12 pm

Re: How to Startup With Commands?

Post by WristWidget »

Noob193 wrote: Wed Feb 11, 2026 10:23 pm Sorry if I wasn't clear, but both the local.rc solution (I made one with sudo nano but kept getting 'file not detected' errors, even when using a hardlink to /home/apple/gpupowerlimit.sh
Huh?
Noob193 wrote: Wed Feb 11, 2026 10:23 pm or moving the file to the /etc/ folder + logging in as user thinking it was a PATH issue)
This doesn't make any sense either.
Noob193 wrote: Wed Feb 11, 2026 10:23 pm and using the simpler "Startup Applications" ui
I still don't see any examples of what you tried and what what errors messages were printed. You can describe how these options failed all day long, but you haven't shown what the failure state actually is.
Noob193
Level 1
Level 1
Posts: 3
Joined: Wed Feb 11, 2026 9:22 pm

Re: How to Startup With Commands?

Post by Noob193 »

I actually ended up fixing it but I'll try to explain everything a little bit more clearly.

1. (Command file is located at /home/apple/)
I followed this guide exactly:(https://www.reddit.com/r/EtherMining/co ... smi_power/) and pointed the local.rc file to my script as below

local.rc file

Code: Select all

#!/bin/bash

/home/apple/gpupowerlimit.sh 15 &

/home/apple/gpupowerlimit.sh > /home/apple/gpupowerlimitsh.log

exit 0
This did NOT trigger the powerlimit OR generate a log file (to show that the rc.local script worked)

Code: Select all

sudo systemctl status rc-local.service 

Can't read /home/apple/gpupowerlimit.sh: No such file or directory

2. I learned elsewhere that running a file through rc.local does so as ROOT
See: (https://stackoverflow.com/questions/239 ... spberry-pi) so I ended up bypassing anything involving "Home" to avoid any ambiguity and placed the "gpupowerlimit.sh" script in /etc/

Here's the updated local.rc file:

Code: Select all

#!/bin/bash

/etc/gpupowerlimit.sh 15 &

gpupowerlimit.sh > /etc/gpupowerlimitsh.log

exit 0
Did NOT trigger the powerlimit command but successfully made the log file (I don't actually understand how that works)

Code: Select all

sudo systemctl status rc-local.service

Can't read /etc/gpupowerlimit.sh: No such file or directory
3. I added the bash command shell to startup + added permission to execute as recommended by (viewtopic.php?p=2630631#p2630631)

No error codes/no trigger


4. I ended up trying 2 again and it miraculously worked. I don't know...

Code: Select all

sudo systemctl status rc-local.service

rc-local.service - /etc/rc.local Compatibility
     Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled-runtime; preset: enabled)
    Drop-In: /usr/lib/systemd/system/rc-local.service.d
             └─debian.conf
     Active: active (exited) since Wed 2026-02-11 23:11:52 EST; 1min 17s ago
       Docs: man:systemd-rc-local-generator(8)
    Process: 2008 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
        CPU: 39ms

Feb 11 23:11:52 apple-MS-7E70 rc.local[2020]: All done.
Feb 11 23:11:52 apple-MS-7E70 sudo[2011]: pam_unix(sudo:session): session closed for user root
Feb 11 23:11:52 apple-MS-7E70 sudo[2032]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/nvidia-smi -i 1,2 -pl 250
Feb 11 23:11:52 apple-MS-7E70 sudo[2032]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Feb 11 23:11:52 apple-MS-7E70 rc.local[2033]: Power limit for GPU 00000000:0C:00.0 was set to 250.00 W from 420.00 W.
Feb 11 23:11:52 apple-MS-7E70 rc.local[2033]: Warning: persistence mode is disabled on device 00000000:0C:00.0. See the Known Issues section of the nvidia-smi(1) man page for more information. Run with [--help | -h] switch to get more information on how to enable persistence mode.
Feb 11 23:11:52 apple-MS-7E70 rc.local[2033]: Power limit for GPU 00000000:11:00.0 was set to 250.00 W from 350.00 W.
Feb 11 23:11:52 apple-MS-7E70 rc.local[2033]: Warning: persistence mode is disabled on device 00000000:11:00.0. See the Known Issues section of the nvidia-smi(1) man page for more information. Run with [--help | -h] switch to get more information on how to enable persistence mode.
Feb 11 23:11:52 apple-MS-7E70 rc.local[2033]: All done.
Feb 11 23:11:52 apple-MS-7E70 sudo[2032]: pam_unix(sudo:session): session closed for user root
All I can say is that computers are magic sometimes, sorry for all the trouble and thank you for taking the time to wade through my attempts at documenting all this.
User avatar
WristWidget
Level 6
Level 6
Posts: 1392
Joined: Wed Sep 25, 2024 11:12 pm

Re: How to Startup With Commands?

Post by WristWidget »

Noob193 wrote: Thu Feb 12, 2026 12:51 am I actually ended up fixing it but I'll try to explain everything a little bit more clearly.
I'm glad you got it fixed, but this whole thread strikes me as a very poor way of understanding the Linux startup process.
Post Reply

Return to “Beginner Questions”