17
votes
How to use the `$HOME` environment variable in systemd service files
The full list of supported variables (called "Specifiers") is here: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers.
There is no specifier for the home directory of user ...
8
votes
Best way to disable swap in Linux
On Raspbian 10 (Buster), the clean answer would be:
To disable it until the next reboot, as stated in */etc/fstab*:
sudo /sbin/dphys-swapfile swapoff
To disable swap on boot:
sudo systemctl disable ...
6
votes
How to use the `$HOME` environment variable in systemd service files
So, as the absence of practical examples in combination with comments makes a feeling like %h doesn't work (it does actually), here's a full example of a service that starts from HOME dir without ...
3
votes
runit - unable to open supervise/ok: file does not exist
If you are running ubuntu 18.04 or higher and getting the following error
unable to open supervise/ok: file does not exist
or if the runsvdir is not showing up in "grep" output then please runit-...
2
votes
Why is technically possible for init to be a shell script?
A shell based rootfs switch is typically via exec switch_root because exec does not fork. Preserves the assumption of PID 1 is init.
This being Linux, of course that's far from the only way to do ...
2
votes
Best way to disable swap in Linux
On my Linux Mint box (version 19.3 (Tricia), based on Ubuntu 18.04 (Bionic Beaver)) without a swap partition or without any swap at all, systemctl reported that swapfile.swap failed during every ...
1
vote
Run custom s6 script in docker container once only
My solution, assuming s6's services in the container are located at /etc/s6/:
docker-compose.yml:
volumes:
- ./data:/data # a mapped or named volume
- ./run:/etc/s6/custom/run:ro
...
1
vote
How to use the `$HOME` environment variable in systemd service files
You could use
WorkingDirectory=~
and set relative paths.
1
vote
Best way to disable swap in Linux
While it doesn't directly solve the author's issue, the comments have evolved into a useful compilation of methods to eliminate swap in various scenarios. As a contribution, I've included one more ...
1
vote
How to list services/daemons started at boot _and_ check their loading order
systemd
On distros using systemd, you can control the order. You have to use a combination of Requires with Before/After. Due to the parallel and relationships among services, the service start-up ...
1
vote
svnserve init.d script
now-a-days it should be so simple (if only svnserve came with it; I'm using v1.9.5 currently):
sudo systemctl enable svnserve
sudo systemctl daemon-reload
but /etc/init.d/svnserve still works for ...
1
vote
Ubuntu - dhcp server 'not configured to listen on any interfaces'
I had a secondary IP address configured for migrating from old subnet to new subnet. I was getting the same Not configured to listen on any interfaces! error.
After finding this post I changed /etc/...
1
vote
Ubuntu - dhcp server 'not configured to listen on any interfaces'
I meet the error, such as "No subnet declaration for eth1" and "Not configured to listen on any interfaces!".
Then I add the eth1 subnet declaration in the dhcpd.conf although the subnet not lease ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
init × 118linux × 48
ubuntu × 20
upstart × 19
debian × 13
systemd × 11
boot × 10
init.d × 10
startup × 9
centos × 8
scripting × 8
bash × 7
service × 6
fedora × 5
ubuntu-14.04 × 5
daemon × 5
redhat × 4
process × 4
ssh × 3
centos6 × 3
kernel × 3
startup-scripts × 3
chkconfig × 3
zombie × 3
inittab × 3