[RESOLVED] rc.local ???

Ответить
Аватара пользователя
monty
Сообщения: 12
Зарегистрирован: 28 дек 2016, 18:31
Operating system: Linux - Rosa linux, CentOS / Debian
Откуда: Czech Republic - Europe
Контактная информация:

[RESOLVED] rc.local ???

Сообщение monty » 19 авг 2017, 10:55

Hi,

I can't find rc.local or something, where I can write, what I would like to start automaticaly after system start.

I need to start automaticaly:

Код: Выделить всё

/sbin/hdparm -B 254 /dev/sda
Thank you

Rene

You can answer me in russian. I understand. Thank you.

Аватара пользователя
monty
Сообщения: 12
Зарегистрирован: 28 дек 2016, 18:31
Operating system: Linux - Rosa linux, CentOS / Debian
Откуда: Czech Republic - Europe
Контактная информация:

Re: [RESOLVED] rc.local ???

Сообщение monty » 19 авг 2017, 11:35

Hi,

I did find it in other distro.

1. Make file /etc/systemd/system/rc-local.service with the content

Код: Выделить всё

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
2. Make rights

Код: Выделить всё

chmod a+X /etc/systemd/system/rc-local.service
3. Make file /etc/rc.local with the content

Код: Выделить всё

#!/bin/sh

/sbin/hdparm -B 254 /dev/sda
exit 0
4. Make rights

Код: Выделить всё

chmod a+X /etc/rc.local
5. Run command (under root)

Код: Выделить всё

systemctl enable rc-local.service
6. Run command (under root)

Код: Выделить всё

systemctl reload rc-local.service
7. Restart PC


Have a good day ;-)

René

Ответить

Вернуться в «Desktop»