NAME
geninitd
DESCRIPTION
Simple utility for init.d scripts creation.
It produces scripts like:
#!/usr/bin/env perl
# created by: noxx
# check_whois:
#
# chkconfig: 345 88 13
# description: whois server
#
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop whois daemon
# Description:
### END INIT INFO
# This script generated by geninit tool
use strict;
use warnings;
use System::InitD::Runner;
# Config
# path to pidfile here:
my $PID = '/var/run/whois/whois.pid';
# start command here:
my $START_COMMAND = 'perl /www/srs/script/whois_async/whois_daemon.pl --user apache --group apache --port 4343 --daemonize --pid $PID';
# EXACT process name here:
my $PROCESS_NAME = 'whois_daemon_master';
my $USAGE = 'start|stop|usage|status';
# Run
my $runner = System::InitD::Runner->new(
usage => $USAGE,
# proces name here:
process_name => $PROCESS_NAME,
# start cmd here
start => $START_COMMAND,
restart_timeout => 5,
pid_file => $PID,
);
$runner->run();
1;
SYNOPSIS
--os
Operating system. Script will be generated for it. Debian format by default.
--author
Script's author, used for description.
--target
Target file. If not, last parameter,
--pid-file --pid_file
Pid file of script, used for monitoring.
--process-name --process_name
Exact process name of script in the ps output. Used for monitoring and manipulation.
--start-cmd --start_cmd
Start command
--service
Service name. For example, my_cool_daemon.