Hello. As far as is known, rc.local does not work in Debian 10, but even when it is created, and then adding the launch of your code through systemd, an error is generated. Perhaps you have a swap blocking solution in Proxmox 6.2?
At first i create /etc/rc.local file with content:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# fix for proxmox kernel swappiness problem, yes, it must be executed twice
for i in `/usr/bin/find /sys /var/lib 2>/dev/null | /bin/grep slice | /bin/grep swappiness` ; do /bin/echo 0 >"${i}" ; done
for i in `/usr/bin/find /sys /var/lib 2>/dev/null | /bin/grep slice | /bin/grep swappiness` ; do /bin/echo 0 >"${i}" ; done
exit 0
do this file executable
chmod +x /etc/rc.local
I try to start rc.local with systemd by create file /etc/systemd/system/rc-local.service
[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
systemctl enable rc-local
systemctl start rc-local.service
if i start manually, all ok but after reboot i have some errors:
Jul 14 09:33:17 prxmx systemd[1]: Starting /etc/rc.local Compatibility...
Jul 14 09:33:17 prxmx rc.local[702]: /etc/rc.local: 14: /etc/rc.local: cannot create /sys/fs/cgroup/memory/system.slice/lxc.service/memory.swappiness: Directory nonexistent
jul 14 09:33:17 prxmx systemd[1]: rc-local.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
jul 14 09:33:17 prxmx systemd[1]: rc-local.service: Failed with result 'exit-code'.
Jul 14 09:33:17 prxmx systemd[1]: Failed to start /etc/rc.local Compatibility.
help me for fix use swap by proxmox. In previos version all works perfectly with content in rc.local
At first i create /etc/rc.local file with content:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# fix for proxmox kernel swappiness problem, yes, it must be executed twice
for i in `/usr/bin/find /sys /var/lib 2>/dev/null | /bin/grep slice | /bin/grep swappiness` ; do /bin/echo 0 >"${i}" ; done
for i in `/usr/bin/find /sys /var/lib 2>/dev/null | /bin/grep slice | /bin/grep swappiness` ; do /bin/echo 0 >"${i}" ; done
exit 0
do this file executable
chmod +x /etc/rc.local
I try to start rc.local with systemd by create file /etc/systemd/system/rc-local.service
[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
systemctl enable rc-local
systemctl start rc-local.service
if i start manually, all ok but after reboot i have some errors:
Jul 14 09:33:17 prxmx systemd[1]: Starting /etc/rc.local Compatibility...
Jul 14 09:33:17 prxmx rc.local[702]: /etc/rc.local: 14: /etc/rc.local: cannot create /sys/fs/cgroup/memory/system.slice/lxc.service/memory.swappiness: Directory nonexistent
jul 14 09:33:17 prxmx systemd[1]: rc-local.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
jul 14 09:33:17 prxmx systemd[1]: rc-local.service: Failed with result 'exit-code'.
Jul 14 09:33:17 prxmx systemd[1]: Failed to start /etc/rc.local Compatibility.
help me for fix use swap by proxmox. In previos version all works perfectly with content in rc.local