Android mobile phone Transformation Server – solve the problem that systemctl cannot be used under chroot
•
Android
For this problem, I also met for the first time. No in-depth study. If there are any problems, please correct them.
When we start the service using systemctl, it prompts us
[root@localhost ~]# systemctl start mariadb
Running in chroot,ignoring request.
Or when using service
[root@localhost ~]# service mariadb start
Redirecting to /bin/systemctl start mariadb.service
Running in chroot,ignoring request.
wget https://github.com/smaknsk/servicectl/archive/1.0.tar.gz
tar -xf 1.0.tar.gz -C /usr/local/lib/
ln -s /usr/local/lib/servicectl-1.0/servicectl /usr/bin/servicectl
ln -s /usr/local/lib/servicectl-1.0/serviced /usr/bin/serviced
sudo servicectl action service
This command only executes ${action} in the file / usr / lib / SYSTEMd / system / ${service}. Service. If the operation is enabled or disabled, servicectl will create or delete symlink on ${service}. Service for use.
Parameters:
sudo serviced action
This command executes ${action} to enable services for all.
Parameters:
# inside chroot
sudo servicectl enable mariadb
# outside chroot:
# init startup and run all enabled daemons
sudo chroot /path/to/chroot serviced
If you know a better way, please leave your way
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码