Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping a newline in dinit service causes an error #291

Open
squeaktoy opened this issue Feb 3, 2024 · 1 comment
Open

Escaping a newline in dinit service causes an error #291

squeaktoy opened this issue Feb 3, 2024 · 1 comment
Labels
C-dinit-service Things about dinit-service Feature Request Request a feature to be added to dinit good first issue It's a good issue for first-time contributors

Comments

@squeaktoy
Copy link

I tried to write a service with a long command so I naturally thought "let's escape the newline with backslash!" but nope, doing so results in this error:

Checking service: slskd...
Service 'slskd' (line 2): backslash escape (`\') not followed by character
Unable to load service 'slskd': badly formed line.
One or more errors/warnings issued.

The slskd service file looks like this:

type = process
command = bwrap --bind $HOME/.local/share/slskd $HOME/.local/share/slskd \
--bind /media/tank/archive /media/tank/archive \
--bind /media/tank/music /media/tank/music \
--bind /media/tank/movies /media/tank/movies \
--bind /media/tank/sound /media/tank/sound \
--bind /media/tank/games /media/tank/games \
--bind /media/tank/downloads/soulseek /media/tank/downloads/soulseek \
--unshare-cgroup --unshare-ipc --unshare-pid --unshare-uts \
--proc /proc \
--dev /dev \
--tmpfs /tmp \
--ro-bind /lib64 /lib64 \
--ro-bind /usr/lib64 /usr/lib64 \
--ro-bind /usr/lib /usr/lib \
--ro-bind /etc/ld.so.cache /etc/ld.so.cache \
--ro-bind /usr/local/libexec/slskd /usr/local/libexec/slskd \
--ro-bind /usr/share/zoneinfo /usr/share/zoneinfo \
--chdir /usr/local/libexec/slskd \
/usr/local/libexec/slskd/slskd
log-type = buffer

Seems weird to my why dinit wouldn't support this. I don't want to write a super huge command on one line.

@davmac314
Copy link
Owner

Seems weird to my why dinit wouldn't support this. I don't want to write a super huge command on one line.

This just hasn't come up before. I agree there's no real reason not to support it. In the meantime, using a shell script to start the service (via exec) is probably a usable workaround.

@mobin-2008 mobin-2008 added C-dinit-service Things about dinit-service Feature Request Request a feature to be added to dinit good first issue It's a good issue for first-time contributors labels Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-dinit-service Things about dinit-service Feature Request Request a feature to be added to dinit good first issue It's a good issue for first-time contributors
Projects
None yet
Development

No branches or pull requests

3 participants