Getting example to work

72 views
Skip to first unread message

Lakshmi Natarajan

unread,
Feb 14, 2012, 8:19:28 PM2/14/12
to hcron-users
Hello there,

This is a really nice application, thanks for making it available. I
am having trouble getting the example to work and wonder if you can
help me.

~/.hcron/events/say_hello:
as_user=
host=localhost
command=echo helloworld > /tmp/hello
notify_email=
notify_message=
when_month=*
when_day=*
when_hour=*
when_minute=*
when_dow=*


# hcron.conf
{
"allow_localhost": True,
"command_spawn_timeout": 15,
"events_base_path": None,
"log_path": "hcron.log",
"max_events_per_user": 25,
# hidden files, emacs backup files
"names_to_ignore_regexp": "(\..*)|(.*~$)|(.*.off$)",
"smtp_server": "localhost",
"test_net_username": None,
"use_syslog": False,
}

conents of /var/lib/hcron/event_lists/indigoadmin:
accepted::/say_hello

I tail the log file and it has:

2012-02-14T19:15:00.851170:message::info:scheduling for next interval
(2012-02-14 19:15:00)
2012-02-14T19:15:00.851526:message::info:signalHome was modified
2012-02-14T19:15:00.852314:discard-events:indigoadmin:1
2012-02-14T19:15:00.854476:load-events:indigoadmin:1:0.0019679069519
2012-02-14T19:15:00.880553:execute:indigoadmin:indigoadmin:localhost:/
say_hello:-1
2012-02-14T19:15:00.881607:work::1:0.0269050598145
2012-02-14T19:15:00.882021:sleep::60

I figure the -1 means something is wrong, not sure what. Also no /tmp/
hello file is created with the hello message. Any ideas what could be
wrong?

Thanks,
Lakshmi

Lakshmi Natarajan

unread,
Feb 14, 2012, 8:23:35 PM2/14/12
to hcron-users
In the postinst file I commented this line before running it because I
didn't have update-rc.d on my system - Oracle Enterprise Linux 2.6

update-rc.d hcron defaults 89 11 >/dev/null

John

unread,
Feb 14, 2012, 9:00:36 PM2/14/12
to hcron...@googlegroups.com
On 02/14/2012 08:19 PM, Lakshmi Natarajan wrote:
> Hello there,
>
> This is a really nice application, thanks for making it available. I
> am having trouble getting the example to work and wonder if you can
> help me.
>
> ~/.hcron/events/say_hello:
> as_user=
> host=localhost
> command=echo helloworld> /tmp/hello
> notify_email=
> notify_message=
> when_month=*
> when_day=*
> when_hour=*
> when_minute=*
> when_dow=*

Hi,

The above may be a typo, but your events directory must be under a directory matching the hostname running the hcron-scheduler.
You can do this:
mkdir ~/.hcron/`hcron-info --fqdn`/events

Then move your say_hello under events/ and do hcron-reload.

So, if your machine is called abc.xyz (as returned by hcron-info --fqdn), then you will have:
~/.hcron/abc.xyz/events/say_hello

More below.

It looks like you are trying to run this on the local machine (via the localhost address). What happens when you do:
ssh localhost date

If it requires interaction (e.g., password, passphrase, or yes/no to allow the session), then the spawn will fail. See the
Configuration->User section of the docs (http://hcron.googlecode.com/files/hcron%20User%20Guide%20-%202010-10-19%20-%201.1.pdf).

Assuming that your ssh keys are properly set up, you may simply need to put the following in your ~/.ssh/config file:
-----
Host localhost
StrictHostKeyChecking no
BatchMode yes
-----

John

Message has been deleted

Lakshmi Natarajan

unread,
Feb 14, 2012, 11:37:17 PM2/14/12
to hcron-users
Awesome thank you, that was it, I had to set up ssh to work without
any interaction.

Yeah that was a typo
~/.hcron/[host name]/events/say_hello

Thanks,
Lakshmi

johnm

unread,
Feb 15, 2012, 8:08:43 AM2/15/12
to hcron-users
Great.

John
Reply all
Reply to author
Forward
0 new messages