Hi,
I noticed some time ago that rc.local became a service. I'm just getting around to
address this issue but am having trouble getting my fedora 41 system to
"notice"
my efforts.
Can someone post what they're doing to implement this new way of doing things,
please?
Best regards,
George...
as already said, you need to create a file named rc.local under /etc/rc.d
rights (here) are:
sudo ls -l /etc/rc.d/rc.local
-rwx------. 1 root root 5298 10. Apr 15:20 /etc/rc.d/rc.local
my content here is mostly stuff powertop told me to set:
my rc.local:
===========================
#!/bin/bash
touch /var/lock/subsys/local
################################################
#
# Powertop setting
#
#################################################
# Wake-on-lan status for device enp3s0
echo 'enabled' > '/sys/class/net/enp3s0/device/power/wakeup';
# Enable Audio codec power management
echo '1' > '/sys/module/snd_hda_intel/parameters/power_save';
# Enable SATA link power management for host0
echo 'med_power_with_dipm' >
'/sys/class/scsi_host/host0/link_power_management_policy';
# Enable SATA link power management for host2
echo 'med_power_with_dipm' >
'/sys/class/scsi_host/host2/link_power_management_policy';
# Enable SATA link power management for host4
echo 'med_power_with_dipm' >
'/sys/class/scsi_host/host4/link_power_management_policy';
# Enable SATA link power management for host1
echo 'med_power_with_dipm' >
'/sys/class/scsi_host/host1/link_power_management_policy';
# Enable SATA link power management for host3
echo 'med_power_with_dipm' >
'/sys/class/scsi_host/host3/link_power_management_policy';
# Enable SATA link power management for host5
echo 'med_power_with_dipm' >
'/sys/class/scsi_host/host5/link_power_management_policy';
# VM writeback timeout
echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
# NMI watchdog should be turned off
echo '0' > '/proc/sys/kernel/nmi_watchdog';
### Autosuspend for USB device USB Receiver [Logitech]
echo 'auto' > '/sys/bus/usb/devices/1-8/power/control';
echo 'auto' > '/sys/bus/usb/devices/1-10.1/power/control';
# echo 'disabled' > '/sys/bus/usb/devices/1-8/power/wakeup';
# Autosuspend for USB device AURA LED Controller [AsusTek Computer Inc.]
echo 'auto' > '/sys/bus/usb/devices/1-2/power/control';
# Autosuspend for USB device USB Audio CODEC [Burr-Brown from TI ]
echo 'auto' > '/sys/bus/usb/devices/1-10.3/power/control';
# Runtime PM for disk sda
echo 'auto' > '/sys/block/sda/device/power/control';
# Runtime PM for PCI Device Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/power/control';
# Runtime PM for PCI Device Intel Corporation Ethernet Controller I225-V
echo 'auto' > '/sys/bus/pci/devices/0000:03:00.0/power/control';
# Runtime PM for port ata1 of PCI device: Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/ata1/power/control';
# Runtime PM for port ata2 of PCI device: Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/ata2/power/control';
# Runtime PM for port ata3 of PCI device: Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/ata3/power/control';
# Runtime PM for PCI Device Intel Corporation Tiger Lake-H Shared SRAM
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.2/power/control';
# Runtime PM for port ata5 of PCI device: Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/ata5/power/control';
# Runtime PM for PCI Device Intel Corporation Tiger Lake-H SPI Controller
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.5/power/control';
# Runtime PM for PCI Device Intel Corporation Device 4c53
echo 'auto' > '/sys/bus/pci/devices/0000:00:00.0/power/control';
# Runtime PM for port ata4 of PCI device: Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/ata4/power/control';
# Runtime PM for PCI Device Intel Corporation Tiger Lake-H PCI Express Root Port #9
echo 'auto' > '/sys/bus/pci/devices/0000:00:1d.0/power/control';
# Runtime PM for port ata6 of PCI device: Intel Corporation Device 43d2
echo 'auto' > '/sys/bus/pci/devices/0000:00:17.0/ata6/power/control';
# Runtime PM for PCI Device Intel Corporation Tiger Lake-H PCI Express Root Port #5
echo 'auto' > '/sys/bus/pci/devices/0000:00:1c.0/power/control';
# Runtime PM for PCI Device Intel Corporation Device 4387
echo 'auto' > '/sys/bus/pci/devices/0000:00:1f.0/power/control';
# Runtime PM for PCI Device Intel Corporation Tiger Lake PCH CNVi WiFi
echo 'auto' > '/sys/bus/pci/devices/0000:00:14.3/power/control';
# Runtime PM for PCI Device Samsung Electronics Co Ltd NVMe SSD Controller
PM9A1/PM9A3/980PRO
echo 'auto' > '/sys/bus/pci/devices/0000:01:00.0/power/control';
# Wake-on-lan status for device wlo1
echo 'enabled' > '/sys/class/net/wlo1/device/power/wakeup';
# Wake status for USB device 1-9
echo 'enabled' > '/sys/bus/usb/devices/1-9/power/wakeup';
# Wake status for USB device 1-14
echo 'enabled' > '/sys/bus/usb/devices/1-14/power/wakeup';
# Wake status for USB device usb1
echo 'enabled' > '/sys/bus/usb/devices/usb1/power/wakeup';
# Wake status for USB device 1-10
echo 'enabled' > '/sys/bus/usb/devices/1-10/power/wakeup';
# Wake status for USB device usb2
echo 'enabled' > '/sys/bus/usb/devices/usb2/power/wakeup';
# Wake status for USB device 1-2
echo 'enabled' > '/sys/bus/usb/devices/1-2/power/wakeup';
exit 0;
===================================================
don't know is the first line "touch /var/lock/subsys/local" is still needed
(it was in elder rc.local present), but it doesn't hurt (here).
to my understanding the systemd service "rc-local.service" just picks up the
file and excutes the content of /etc/rc.d/rc.local
sudo systemctl restart rc.local or a reboot
more to read:
man systemd-rc-local-generator