SUSE 12.3 - How to auto start services...?

I read that SysV has been replaced by systemd. And that the /etc/init.d structure is now no longer is active.
So how do I get the same effect that I saw in 12.2 with YaST | System | System Services (Runlevel)?

If I enabled nfs or xinetd or ddclient or whatever, when I rebooted, these services were up and running for me.
Now, when I enable the service, sure enough they start. But after a reboot, they are no longer running.

Days of research have yet to reveal the required technique! Can anyone help?

Best regards, Martin

Which services exactly could not be enabled?

The three quoted above (at least).

Regards,

On 2013-03-30 17:26, martinprowe wrote:

> If I enabled nfs or xinetd or ddclient or whatever, when I rebooted,
> these services were up and running for me.
> Now, when I enable the service, sure enough they start. But after a
> reboot, they are no longer running.
>
> Days of research have yet to reveal the required technique! Can
> anyone help?

I should not be surprised… YaST is broken. Systemd has come, Yast
developers are a scarce resource, and modules are not working any more
as a result :-/

I understand that you have to use “systemadm” now.

View this
thread here
A post by jdmcdaniel3 explains it.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Yes, I have read that. And tried systemadm…

However, there is only (that I can find) the START | STOP | RESTART buttons. Nowhere can I find a load at startup type setting!
I know its early days but system-ui seems a little … er… half finished?

Regards, Martin

I enabled “nfs” and “autofs”. I think that implicitely enables “rpcbind”. That still works after reboot.

To do it manually, outside of Yast, I would have needed something like:


systemctl start rpcbind.service
systemctl enable rpcbind.service
systemctl start nfs.service
systemctl enable nfs.service
systemctl start autofs.service
systemctl enable autofs.service

The “start” lines are supposed to start for this session, and the “enable” lines are supposed to configure for automatic start in future sessions.

There are probably some firewall changes needed for some services.

All of them are legacy sysvinit scripts, and indeed YaST2 apparently cannot manage them. You can use “systemctl enable xinetd.service” (should work for both native and legacy services) or directly “chkconfig xinetd on”.

All mentioned services are legacy sysvinit scripts, so it is rather chkconfig … :slight_smile:

On 2013-03-30 18:16, martinprowe wrote:

> Yes, I have read that. And tried systemadm…
>
> However, there is only (that I can find) the START | STOP | RESTART
> buttons. Nowhere can I find a load at startup type setting!
> I know its early days but system-ui seems a little … er… half
> finished?

Oh :frowning:

As I have not 12.3 running (only a test partition on the laptop) I did
not try that myself.

Did you try if


chkconfig nfs
chkconfig nfs on

works? They said it would be maintained.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

chkconfig nfs on

works?

Yep. That does it for me! Thanks everyone. :slight_smile:

They said it would be maintained.

Just out of curiosity. Who are “they”?

Regards, Martin

On 2013-03-30 20:46, martinprowe wrote:

>> They said it would be maintained.
>
> Just out of curiosity. Who are “they”?

Heh! Good question.

It was a post from Kulow, IIRC. But I could be mistaken and be someone
else from SUSE.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

So what is the new method of starting a service at boot that isn’t really a service?

I am running mediatomb on my desktop (openSUSE 12.3) to stream my movies and songs over to my ps3. I can start mediatomb up no problem with either /etc/init.d/mediatomb start, or I can use systemctl start mediatomb. However when I reboot the program isn’t running and I have to drop to a terminal and start it by hand.
I’ve used chkconfig to set mediatomb to on but for some reason it isn’t working either.

Is this more an issue with the program or is there something in the way the os is starting that is causing it to misfire and not catch the program along the way?

On 04/06/2013 07:36 PM, diensthunds pecked at the keyboard and wrote:
> So what is the new method of starting a service at boot that isn’t
> really a service?
>
> I am running mediatomb on my desktop (openSUSE 12.3) to stream my
> movies and songs over to my ps3. I can start mediatomb up no problem
> with either /etc/init.d/mediatomb start, or I can use systemctl start
> mediatomb. However when I reboot the program isn’t running and I have to
> drop to a terminal and start it by hand.
> I’ve used chkconfig to set mediatomb to on but for some reason it isn’t
> working either.
>
> Is this more an issue with the program or is there something in the way
> the os is starting that is causing it to misfire and not catch the
> program along the way?
>
>
Did you enable mediatomb?


systemctl enable mediatomb.service

You know if mediatomb does not start on its own, you could place a start command in the after.local script, after you activate per this blog: systemd and using the after.local script in openSUSE 12.1 - Blogs - openSUSE Forums

Or, you could do the same thing with mediatomb as I did with dkms and move it over to a real systemd service. Have a look how I did this here: DKMS & systemd - How to get Dynamic Kernel Module Support to work in openSUSE 12.1 - Blogs - openSUSE Forums

While the former may be the easiest, do give it a try, the latter is not that big a deal. With a few name changes, you could use my very script to convert mediatomb.

Thank You,

insserv mediatomb
  • or -
chkconfig mediatomb on

Yes I tried that. Received the following

systemctl enable mediatomb.service 
mediatomb.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mediatomb on

After a reboot it not only didn’t start the mediatomb server it didn’t enable it either.

Tried the insserv mediatomb as well as the chkconfig mediatomb and neither works after a reboot.

using chkconfig mediatomb shows that it is on after a reboot but the program isn’t showing up on the ps3 as being available, hence I’m thinking it’s not actually being started. I still have to manually start it from a terminal.

The more I dig into this the more I’m thinking that the programs scripts are not working with the new systemd setup but then again I could be wrong.

Which is why I provide two alternatives for you. Do a simple start in a bash script on startup, or actually fix the problem br creating your own systemd service. How bad do you want this to work? Of course you can report the issue as a bug fix required, but mediatomb comes from Packman just like dkms does, so its hard to know who to complain to.

Thank You,

I’m looking at your second example as this would be a more standardized correct way to have the mediatomb service running within the distro and be actually systemd compatible Unfortunately I’m neither a programer or a bash scripter.

Step one can be accomplished because I know that /etc/init.d/mediatomb is only working when called on the terminal and not working with the systemd setup.
Step two I have to ask, should a mediatomb bash script be moved over to the /usr/sbin as these are all executable files rather than bash scripts.
Step three is /lib/systemd/system/ the correct place to put the files? How am I to know exactly what goes into the mediatomb.service file?

So for step 2, yes you can move /etc/init.d/mediatomb to /usr/sbin, as this is where I moved the dkms_autoinstaller bash script from /etc/init.d. For step 3 it should work there, but if you wanted to have a /lib/systemd/applications folder, you can do that. The systemctl enable command must just point to its location, such as in systemctl enable /lib/systemd/applications/mediatomb. When using my example service file, make sure to remove the line that says ExecStartPre=/usr/local/bin/userfix from the service file as it was intended to allow you to run a bash script for any purpose before I would start dkms. Also consider that once you make it work manually, you could modify the make-dkms-installer to do your bidding by installing the mediatomb stuff instead. After mediatomb works, consider modifying the bash script I wrote, make your best effort and post it back here. I can make any other required changes. Once complete, you can run it on each openSUSE install and get mediatomb working again. That is what I have done so far with dkms. On each new openSUSE install, I install dkms and try to make it run under systemd with no modifications. If its a no go, I just run the make-dkms-installer and I am back in business. No need to remember exact details of how you did it before and you can just look back at the script if there is any doubt. Go for the first part and make it work under systemd, then we can look at the rest.

Thank You,