diff --git a/systemd/README.md b/systemd/README.md new file mode 100644 index 00000000..038d9c25 --- /dev/null +++ b/systemd/README.md @@ -0,0 +1,12 @@ +sudo mv custom.target /etc/systemd/system/custom.target + +sudo mv new.service /etc/systemd/system/custom.target.wants/new.service + +sudo systemctl list-units --type target --all + +sudo systemctl isolate custom.target + +sudo ln -sf /etc/systemd/system/custom.target /etc/systemd/system/default.target + +sudo reboot now + diff --git a/systemd/custom.target b/systemd/custom.target new file mode 100644 index 00000000..05b22684 --- /dev/null +++ b/systemd/custom.target @@ -0,0 +1,5 @@ +[Unit] +Description=Custom Target +Requires=multi-user.target +After=multi-user.target +AllowIsolate=yes diff --git a/systemd/new.service b/systemd/new.service new file mode 100644 index 00000000..3c38fee9 --- /dev/null +++ b/systemd/new.service @@ -0,0 +1,10 @@ +[Unit] +Description=My last command +After=multi-user.target + +[Service] +Type=simple +ExecStart=/home/pi/CubeSatSim/demo.sh > /home/pi/CubeSatSim/log.txt 2>&1 + +[Install] +WantedBy=custom.target