New answers tagged

8

On any system using systemd, running an init.d script directly won't be the best way to start a service, since it will bypass all settings and bookkeeping usually done by systemd itself. Also, you might not even have an init script, the service might be described only in a unit file. With "old-style" sysvinit there was not much bookkeeping to do: starting ...


1

You can use the Monit for that. It will automatically check for services running and will start them if they not. Monit even can email you about that You'll need to configure for that first, but Monit is a great and lightweight tool for every system administrator. You can look for few examples how to install and configure Monit here.


0

It's likely your question didn't attract an answer because of the generic question of "What's wrong with my file?". Try asking a specific question next time. In this case you think the issue might be that the script before MySQL was ready. You can confirm if that's the case. Manually turn off MySQL and run the script. It should produce the same result. ...


1

NOTE- The answer from Argonauts worked with some mods. Here is the working version in my environment based on a standard install: # xymonlaunch.service # systemd file for Fedora 18 and up, or RHEL 7 and up [Unit] Description=Xymon systems and network monitor Documentation=man:xymon(7) man:xymonlaunch(8) man:xymon(1) After=network.target [Install] # ...


0

The possibility to use suffixes like K and `M were introduced with systemd 228, Debian Jessie ships systemd 215 and hence cannot use this feature. As a workaround you can manually perform the multiplication and specify bytes instead.


0

Usually systemd can convert init.d scripts into services without you having to generate a .service unit file - if the scripts are in the init.d directory, are executable and can be parsed succesfully by systemd, then (without a .service file) running systemctl status xymon should just work. That, obviously, isn't always the case. The only service that I have ...


0

If you don't care about editing the original system scripts, inside the script you can create a function like timeoutf(){ #If hangs 1 minute, dies.. sleep 1m kill $PPID } timeoutf&


4

You can use timeout command to run your command or script in a given timeout. Something similar to this: timeout 10m command Which waits for the command to finish withing 10 minutes otherwise kills it and exits with status 124. Then you can check exit status of timeout and print the appropriate message based on it. See here for more: timeout manpage. If ...


0

I resolved this by editing the offending line in /etc/rc.d/init.d/znc from: daemon --user $runas "$exec -d $config >/dev/null 2>&1" to the following: daemon --user $runas "$exec -d $config >/dev/null" (i.e., Remove the stderr redirect, 2>&1) This now gives me confirmation that the service started OK or that it failed: root@localhost ...


0

sealert -l 92a5910b-1bfe-4b98-a2de-d773cce85051 will describe the exact cause, in the summary section you'll find the file name & the selinux context for fixing the issue execute the below command. chcon -t selinux_context 'file_name' A suggested command to allow access and resolve the denial. it gives the command to change the file1 type to ...


0

I you are running systemd, you can query all service status with: systemctl list-units


1

This discusses my nosh toolset specifically, but some of the concepts apply to other members of the daemontools family. You might want to tell the Gentoo people that their Process Supervision wiki article is woefully outdated and incomplete. Service status for humans Obtaining service status in human-readable form is of course done with the svstat, ...


0

The original Bernstein daemontools has no mechanism for this. There is only a run program in the service directory and a fixed auto-restart policy. However, several members of the daemontools family have improved upon this, and have flexible general-purpose mechanisms that can be employed to address such situations. Gerrit Pape's runit and Laurent ...


1

This is half-baked stuff you can't simply enable. Refer to the corresponding bug report and the thread linked from there. You'll have to choose an implementation (update-motd.d or custom pam_exec) and configure the missing parts.


1

Aha, I feel silly now: [vagrant@localhost ~]$ sudo service atd restart Stopping atd: [FAILED] Starting atd: [ OK ] [vagrant@localhost ~]$


0

I'd find your answer on stackoverflow.com: Run a Java Application as a Service on Linux Running Java process as Service in Linux The details of the answer are distribution-dependent.



Top 50 recent answers are included