servicectl
servicectl copied to clipboard
/usr/local/bin/servicectl: 16: [: -ne: unexpected operator
trying this to start crate from within linux deploy on android debian jessie gets me: android@localhost:~$ sudo servicectl enable crate /usr/local/bin/servicectl: 16: [: -ne: unexpected operator /usr/local/bin/servicectl: 23: /usr/local/bin/servicectl: Syntax error: "(" unexpected android@localhost:~$
This project is either dormant or abandoned. Try https://github.com/gdraheim/docker-systemctl-replacement instead.
These scripts assume /bin/sh is bash. Just replace the shebang with your path to bash and it will work.
I also had this issue, but it gets worse. After fixing the shebangs the scripts don't work on Debian Stretch in Linux Deploy on Android.
They only expect service files to be in /usr/lib/systemd/system/
when they are actually in /etc/systemd/system/
This project is either dormant or abandoned. Try https://github.com/gdraheim/docker-systemctl-replacement instead.
I agree that this project seems to be dormant/abandoned, but I'm not wanting docker stuff.
I got this particular line to work by changing two lines in /usr/local/bin/servicectl but there are still other issues that I haven't been able to figure out.
In case anyone's curious:
line 0: #!/bin/sh
to #!/bin/bash
&
line 16: if [ $EUID -ne 0 ]; then
to if [ "$EUID" -ne 0 ]; then
based on: https://stackoverflow.com/questions/18215973/how-to-check-if-running-as-root-in-a-bash-script
I'm running ubuntu 18.04 bionic in a chroot
I got this particular line to work by changing two lines in /usr/local/bin/servicectl but there are still other issues that I haven't been able to figure out.
In case anyone's curious:
line 0:
#!/bin/sh
to#!/bin/bash
& line 16:if [ $EUID -ne 0 ]; then
toif [ "$EUID" -ne 0 ]; then
based on: https://stackoverflow.com/questions/18215973/how-to-check-if-running-as-root-in-a-bash-script
I'm running ubuntu 18.04 bionic in a chroot
root@localhost:~# servicectl restart sshd Error: attribute PIDFile not exists in file /usr/lib/systemd/system/sshd.service Error: file /usr/lib/systemd/system/sshd.service cannot be opened
↑ ?
Error: attribute PIDFile not exists in file /usr/lib/systemd/system/sshd.service Error: file /usr/lib/systemd/system/sshd.service cannot be opened
It works for me by changing line 7:
SYSTEMD_UNITS_PATH="/usr/lib/systemd/system/"
to SYSTEMD_UNITS_PATH="/lib/systemd/system/"
It works for me by changing line 7:
SYSTEMD_UNITS_PATH="/usr/lib/systemd/system/"
toSYSTEMD_UNITS_PATH="/lib/systemd/system/"
Hi, what's environment you are using? @Xie-Long-0
I run this in docker container. I noticed it called kill -TERM $PID
in action stop
and restart
, I run this manually, but this doesn't work, may because of the PID namespace isolation.
what's environment you are using?
@ruquanzhao I run in chroot, which created by Linux Deploy on Android. Seems like its pids are inherited from the host.
@Xie-Long-0 I run in chroot, which created by Linux Deploy on Android. Seems like its pids are inherited from the host.
I'm also using linux deploy
and changed the code as you said(https://github.com/smaknsk/servicectl/issues/4#issuecomment-1137206830), but the problem still exists
root@localhost:/etc# servicectl restart mcsm-web.service
Error: attribute PIDFile not exists in file /lib/systemd/system/mcsm-web.service
Error: file /lib/systemd/system/mcsm-web.service cannot be opened
this problem was fixed but... WARN[IMNOTGONNASHOWYOUTHETIME] Error while setting daemon root propagation, this is not generally critical but may cause some functionality to not work or fallback to less desirable behavior dir=/var/lib/docker error="error writing file to signal mount cleanup on shutdown: open /var/run/docker/unmount-on-shutdown: no such file or directory" Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd