[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LDM #TMR-136733]: Is it possible to run LDM as a Linux service?



Hi Andy,

As you've discovered, configuring systemd(8) is non-trivial. It's a complex 
system and way more than what's needed to run the LDM. Most Linux systems 
support boot-time scripts like our example at 
<https://www.unidata.ucar.edu/software/ldm/ldm-current/basics/configuring.html#boot>.
 We recommend that you use this mechanism.

> We recently forgot to start LDM after our server crashed and rebooted.  I'd 
> like to set it up to automatically restart.  I followed instructions on how 
> to create a Linux service, but the server doesn't run as expected.
> 
> Instructions I used as a guide for how to create a service: 
> https://unix.stackexchange.com/questions/478999/how-can-i-make-an-executable-run-as-a-service
> 
> Here's what I used as the /etc/systemd/system/ldm.service file:
> 
> [Unit]
> Description=ldm
> 
> [Service]
> User=ldm
> ExecStart=/home/ldm/bin/ldmadmin start
> 
> [Install]
> WantedBy=multi-user.target
> 
> Everything looked good in the log file. Here's the status output:
> 
> sudo systemctl status ldm.service
> ? ldm.service - ldm
> Loaded: loaded (/etc/systemd/system/ldm.service; disabled; vendor preset: 
> enabled)
> Active: inactive (dead)
> 
> Dec 04 22:00:49 ip-172-31-43-181 ldmadmin[17318]: Checking pqact(1) 
> configuration-file(s)...
> Dec 04 22:00:49 ip-172-31-43-181 ldmadmin[17318]:     
> /home/ldm/etc/pqact.conf: syntactically correct
> Dec 04 22:00:49 ip-172-31-43-181 ldmadmin[17318]: Checking LDM 
> configuration-file (/home/ldm/etc/ldmd.conf)...
> Dec 04 22:00:49 ip-172-31-43-181 ldmadmin[17318]: Starting the LDM server...
> Dec 04 22:11:28 ip-172-31-43-181 systemd[1]: Started ldm.
> Dec 04 22:11:40 ip-172-31-43-181 strace[19908]: Checking the product-queue...
> Dec 04 22:11:40 ip-172-31-43-181 strace[19908]: Checking pqact(1) 
> configuration-file(s)...
> Dec 04 22:11:40 ip-172-31-43-181 strace[19908]:     /home/ldm/etc/pqact.conf: 
> syntactically correct
> Dec 04 22:11:40 ip-172-31-43-181 strace[19908]: Checking LDM 
> configuration-file (/home/ldm/etc/ldmd.conf)...
> Dec 04 22:11:40 ip-172-31-43-181 strace[19908]: Starting the LDM server...
> 
> However, when I went and ran 'ldmadmin watch' I was informed that the server 
> was not running.  One thing that occurs to me is that 'ldmadmin' isn't 
> actually the server, it spawns the server.  So maybe that's causing problems?
> 
> Anyway, I find it hard to believe that I'm the first person to try this.  I 
> checked the FAQ and other places and didn't see this covered, and no hits on 
> Google (no surprise).
> 
> Do you have any words of wisdom to impart?

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: TMR-136733
Department: Support LDM
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.