1

I see that the daemon service is started and stopped via the commands:

startsrc and stopsrc on group/subsystem.

I have init.d script and I want to make it daemon service in AIX. From these commands I think I have to put the init.d script into a group and then the starting and stopping of the service will be done by the commands "startsrc" and "stopsrc" executed on the group/subsystem.But how can I put the init.d script into a group/subsystem?

Gordon
  • 21

1 Answers1

2

I have init.d script

Don't start from there, especially if it came from a non-AIX system. This is almost certainly rubbish that will lead you up the garden path.

Just plonking an rc script under the service manager is a sin that people commit on Linux operating systems using systemd, but it has been a sin for a long time, especially on AIX, which has had proper service management since 1990.

Use the mkssys command to define your subsystem, which you can then start and stop as you said with startsrc and stopsrc. Use the rmssys to remove it if you ever want to do that. Use the -s option to all of these with a unique name for your subsystem.

You more probably than not want -S with mkssys, and -R. Just work out the command path and arguments for your dæmon process, and the user ID it is to run as, and employ the -p, -a, -u options appropriately.

Your rc script will give you a clue as to the command path and arguments, but that will probably be buried under a heap of shell variables and stuff. That's probably the only information in the rc script that will be useful to you.

JdeBP
  • 68,745
  • Thanks , I was also wondering when we create mkssys entry let's call it , "mySysEntry" and start it via startsrc -s mySysEntry -a "start" the service starts indeed, however "lssrc -a" shows that mySysEntry is not operational, how can I make lssrc -a to show that the service is active? – Gordon Jan 23 '20 at 16:01
  • IBM's mkssys documentation: https://www.ibm.com/docs/en/aix/7.3?topic=m-mkssys-command – Scott Centoni May 25 '23 at 19:18