In this video, I'll show you how you can use systemd to run anything.
So to do so, I'm going to base my work on a generic unit file.
So I'm copying user lib systemd system, and I'm using vsftpd.service because that unit
file is not too big, and I'm copying it into etc systemd system, and I'm calling it sleep.service.
And next, I'm editing etc systemd system.
I'm honoring the requirements here that self-made stuff should not be a user lib systemd, but
should be an etc systemd system.
So I'm going to edit it, and then I have the description, and the description is sleepy
service.
And after network online target, why not?
I don't really care about it.
Now we have the service type is forking.
No, I want it to be type is simple.
Type is simple is what you use to run any command in systemd.
And the xx start, well, that would just be the command that I wanted to run, and that
is user bin sleep infinity.
And install, well, wanted by is multi-user target.
Yeah, I want to be able to enable this unit.
Now as I've written a new configuration to disk, I'm going to use systemctl daemon reload.
Daemon reload makes sure that systemd checks all of its configuration locations, and it
will learn about this new file.
And next, I'm using systemctl enable minus minus now on sleep.service.
And there we can see that it creates a symlink, OK?
And systemctl status on sleep.service is showing me that it is active and that it is running.
And that's actually quite cool.
You can run anything in systemd.
And even as you will learn later in the lessons about containers, even users can run anything
in systemd.
So, to be continued.