How to run a startup script using systemd

preview_player
Показать описание
Today's tip is how to run a startup script using systemd. If everything you need is to run a simple startup script when you boot into Linux, there's no need to become an expert in systemd. Below are the files I used on this video.

#!/bin/sh

hdparm -Y /dev/sdb

[Unit]
Description=Startup

[Service]

[Install]
Рекомендации по теме
Комментарии
Автор

Simple and Educative. Works Like A Charm. Cheers!

tomasz-konstantinakula-aga
Автор

"Use linux long and prosper" subscribed!

Adnan
Автор

A lot of help :D Everytime i install any linux in my notebook, i MUST create an Anti-Throttle startup script, otherwise, my notebook become almost unusable. Thank you so much.

Rorrox
Автор

This helped me a lot using Pure OS thank you!

PotentialEnrgy
Автор

Thank you!
With help of your video my CPU undervolts at boot.

vladislavkaras
Автор

Thanks so much. As someone who is new to Linux, this has been a VERY helpful video. <3 <3 <3

byzantineJesusLovR
Автор

Excellent. Used this to load modules that were failing at boot on my PowerMac G5 running Debian. Thank you, and well done!

amathenge
Автор

Thank you very much man! It is very much appreciated!

ignaciodamiang
Автор

amazing content bro keep it up just subscribed to your channel

Tech_Brigadier
Автор

Thank you very much. It worked perfectly.

dropcake
Автор

Im using Deepin OS.
I wanna run " sudo cpupower frequency-set -g powersave -d 0.4G -u 1.0G" at boot.
I did same as the video tells.
But no hope.
It doesnt work.😔😔😔😔😔

isuruthiwanka
Автор

Video Summary

1) put your script at /usr/local/sbin/

2) make it executable

3) create your .service file in /etc/systemd/system

4) your.service file:
[Unit]
Description=yourscript

[Service]


[Install]
WantedBy=multi-user.target

5) sudo systemctl enable your.service

check it working:
1) systemctl start your.service

2) systemctl status your.service

auroramonet
Автор

came back after rebooting just to like the video. I setup a script to fix an error with Dayz not booting unless a command was written in terminal.

MadviIIains
Автор

What is the difference between this approach and using cron to run a script at reboot?

userwww
Автор

Thank you so much, this is only tutorial working on my ubuntu. I tried everything but nothing worked.

gautamkartik
Автор

WHAT DID YOU DO AT 1:26? HOW DID YOU GO BACK?

madsli
Автор

hdparm -Y /dev/sdb

as from here and you switch back to the main terminal, if I close the (hdparm -Y /dev/sdb) screen they will kill everything so I am not sure how to switch back to the terminal? Sorry I am very new to linux!

reflexsamurai
Автор

That worked perfectly, thank you so much!

icewatermansion
Автор

HELLO SIR PLEASE I NEED YOUR HELP!!! I am trying to configure this file on an sdcard to boot up my raspberry pi that is headless so it starts ssh. I am having trouble with the last part, enabling the service, because I cannot actually access the system to give it that permission using sudo. Please I need help reply

arrowhead
Автор

I followed exactly as you did but something seems to be wrong. Could you please tell what might have gone wrong ? I am on Kali Linux
"Linux kali 5.9.0-kali4-amd64 #1 SMP Debian 5.9.11-1kali1 (2020-12-01) x86_64 GNU/Linux"

Prakhar_Choubey
welcome to shbcf.ru