In Ubuntu, you just put a ?.service file in /usr/lib/systemd/system
There are probably already some examples there that you can use to see how
it's done. For example, when I run the tomcat 10 installation I get:
    /usr/lib/systemd/system/tomcat10.service
which causes tomcat to start when I reboot.
Then you have to run
    sudo systemctl daemon-reload
Eventually you will see a copy of the file in
    /etc/systemd/system/multi-user.target.wants
and your service will now run after you reboot ( or simply run sudo
systemctl start <your_new_service_name>.service )
Isn't this how it works on other flavors of linux?
On Thu, Mar 13, 2025 at 9:31 AM Gary <saclug(a)garymcglinn.com> wrote:
  Before, I could just add things to rc.local if I
wanted them to run at
 start up.According to the systemd docs, I should still be able to do that.
 According to the web, and my experience, it doesn't work.
 NP.  I'll just make a systemd unit and do it right.  There are 12
 different kinds.  Trying to read the docs and figure out what to do is
 going to be fun.  I just copy a template from the web that is suppose to do
 what I want. There apparently aren't any tools to make this easier because,
 "It's all really simple already."  Conceptually, it does look fairly
 straightforward, if I had the info I needed.  Which is probably there.  I
 just have to do a lot of reading and get a lot of religion.
 My executable runs and does what I want.  Let's fire up the systemd
 service and see what happens.  Oh, SELinux happens.
 I haven't played with SELinux.  Perhaps now is a good time to learn.  I am
 somewhat curious why the SELinux interface tells me a temporary workaround
 and not a permanent fix.  But, with what it does tell me, I figure I have
 to learn about SELinux policies.
 Are you kidding me?
 I have to install an _devel package.  I can follow the cookie cutter
 script, which has 10 nontrivial steps.  I start, but I don't get the
 results that the script tells me I should.  Since I don't know what I'm
 doing, I have no idea if this will be a problem or not.
 There are only 10 or so man pages I need to read.  I'm sure none of them
 are short.
 How long has this stuff been around now?
 Am I missing something?  Because it looks like something I stepped in once.
 We went from adding a line in a file, to all this.  It is allegedly more
 secure.But it looks to me that things could be a lot easier and someone
 made a big mistake somewhere.
 I haven't decided how I'll proceed.  I either turn off SELinux and start
 my stuff automatically.  Or keep starting it manually, as I do now.  It's
 on a box I like to keep secure, so there is that.
 Is there a way out or around that I have missed?
 _______________________________________________
 Lug-nuts mailing list -- lug-nuts(a)bigbrie.com
 To unsubscribe send an email to lug-nuts-leave(a)bigbrie.com