coderbunker / linux

4 stars 0 forks source link

Lab 4.2 failed #10

Open Jeff-Tian opened 8 years ago

Jeff-Tian commented 8 years ago

by command systemctl can't be found and can't be installed by sudo apt-get install systemctl.

https://lms.360training.com/scorm/linuxfoundation/LFS201/Lab%204.2.pdf

dulhaver commented 8 years ago

Same experience here. Worked on a 16.04 ununtu machine for me

rosscournoyer602 commented 8 years ago

16.04 uses systemd so it is easy to get this working. 14.04 still uses upstart so you must use put it in a different place:

nano fake_service /etc/init.d/fake_service chmod 755 /etc/init.d/fake_service

and use a different command to stop and start it:

service fake_service [start/stop]

Jeff-Tian commented 8 years ago

@rosscournoyer602 you are right. However there are errors when issuing service fake2.service start with the following content in the /etc/init.d/fake2.service which is on the pdf lab mannual:

[Unit]
Description=fake2
After=network.target
[Service]
ExecStart=/bin/echo I am starting the fake2 service
ExecStop=/bin/echo I am stopping the fake2 service
[Install]
WantedBy=multi-user.target

The error is like:

/etc/init.d/fake2.service: 1: /etc/init.d/fake2.service: [Unit]: not found