Current time: 09-29-2024, 09:17 AM Hello There, Guest! (LoginRegister)


Post Reply 
Writing CronJobs Web int. It's time!
Author Message
data-stream_ru Offline
Moderator
*****
Moderators

Posts: 471
Joined: Jan 2009
Reputation: 7
Post: #10
RE: Writing CronJobs Web int. It's time!
hcrond...
So litle program and so more problems and bugzzzz Sad
Columns gid and uid use Names of user and names of groups, not gid/uid!
Column "machine" is ignored.
Column "andor" can crash job.
But the table have a column "lastrun". Looks nice. We can use it for control of Jobs exucutabling.

During compilation i lost 3-4 hours becouse information about needed preinstalled packes is absent or wrong! -
In new mysqld we do not need libmysqlclient-devel, we need mysql-devel !
And we need "lex" in PATH or properly installed "flex" pacage.

I rewrite Makefile for x64 systems whith lines
CFLAGS=-std=c99 -Wall -W
LDFLAGS= -I'/usr/include/mysql' -L/usr/lib64/mysql -lmysqlclient -ldaemon -lpthread

And I rewrite ./init.d/hcrond for chkconfig
Code:
#!/bin/bash
# hcrond        Startup script for the hcrond
#
# chkconfig: - 90 12
# description: Startup script for hcrond
# processname: hcrond
# config: /etc/hcrondrc
# pidfile: /var/run/hcrond.pid

# Source function library.
. /etc/rc.d/init.d/functions

test -f /usr/bin/hcrond || exit 0

. /lib/lsb/init-functions

pidfile=/var/run/hcrond.pid
lockfile=${LOCKFILE-/var/lock/hcrond}

## TODO get from /etc/hcrondrc

case "$1" in
start)
    echo -n  "Starting hcrond..."
       daemon hcrond
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        ;;
stop)  
    echo -n  "Stopping hcrond..."
       killproc hcrond
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
        ;;
restart)
    echo -n  "ReStarting hcrond..."
       killproc hcrond
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
    daemon hcrond
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        ;;
reload|force-reload)
    echo -n  "Reloading configuration files for hcrond..."
        # cron reloads automatically
        echo $?
        ;;
*)      echo "Usage: /etc/init.d/hcrond {start|stop|restart|reload|force-reload}"
        exit 1
        ;;
esac
exit 0

Its worked.

Now I asked my Cooder to do litle add in main.c to posibility use column "activ" for compatibiliti for ispCP templates.

So more truble Sad I do not know can I (whith my Home-Bear) to drink so lot of Russian Vodka for solving this problems or we have a risc to meet a doctors Wink
(This post was last modified: 01-08-2009 05:11 AM by data-stream_ru.)
01-08-2009 04:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Writing CronJobs Web int. It's time! - data-stream_ru - 01-08-2009 04:51 AM

Forum Jump:


User(s) browsing this thread: 3 Guest(s)