search for: exec_cmd

Displaying 18 results from an estimated 18 matches for "exec_cmd".

2013 Dec 05
0
Plea for a more loquacious nut
...behind "if" conditions that ensure that little or nothing gets through. Long ago I wrote software, including a compiler, but my C programming is limited to a class exercise many many years ago, and its based on this "experience" that I'm guessing that in upssched.c function exec_cmd the code > > snprintf(buf, sizeof(buf), "%s %s", cmdscript, cmd); > err = system(buf); > if (WIFEXITED(err)) { > if (WEXITSTATUS(err)) { > upslogx(LOG_INFO, "exec_cmd(%s) returned %d", buf, WEXITSTATUS(err)); > } > > attempts to send a command...
2013 Dec 04
5
Plea for a more loquacious nut
...nd "if" conditions that ensure that little or nothing gets through. Long ago I wrote software, including a compiler, but my C programming is limited to a class exercise many many years ago, and its based on this "experience" that I'm guessing that in upssched.c function exec_cmd the code snprintf(buf, sizeof(buf), "%s %s", cmdscript, cmd); err = system(buf); if (WIFEXITED(err)) { if (WEXITSTATUS(err)) { upslogx(LOG_INFO, "exec_cmd(%s) returned %d", buf, WEXITSTATUS(err)); } attempts to send a command to the operating system, possibly t...
2020 Mar 19
0
exec_cmd(/path/upssched-cmd event) returned 78
Hello, not sure if it is a scripting problem or an owner/group problem but when I try to send an email following en event using upssched-cmd, the script exits on the line where I send the email with this message in syslog : Mar 19 20:49:51 chaudron-nautique upssched[1377]: exec_cmd(/path/upssched-cmd onbatt1) returned 78 The log messages prior to the email (logger -t upssched-cmd message) can be found in syslog thus I'm sure that upssched-cmd is called when the event occurs and if I run ~#./upssched-cmd onbatt1as root, the mail is sent properly. I tried a few things...
2012 May 15
2
Timer Daemon doesn't start
...and I don't find the failure. Maybe someone can help me and tell me where the failure could be. --- syslog --- May 13 21:50:34 s-monitor1 upsmon[1674]: UPS usv3 at localhost on battery May 13 21:50:34 s-monitor1 upssched[855]: Executing command: ONBATT May 13 21:50:34 s-monitor1 upssched[855]: exec_cmd(/etc/nut/upssched-cmd ONBATT) returned 126 May 13 21:51:04 s-monitor1 upsmon[1674]: UPS usv1 at localhost on battery May 13 21:51:04 s-monitor1 upsmon[1674]: UPS usv2 at localhost on battery May 13 21:51:04 s-monitor1 upssched[1173]: Executing command: ONBATT May 13 21:51:04 s-monitor1 upssched[117...
2006 Jun 26
0
Using a partial multiple times in a view
Hi, im trying to execute multiple cmds in a method that use the same view which has multiple calls to the same partial inside it. However i cant get it to work correctly, so any help here would be appreciated heres the controller code def index cmd_df = "df -Ph" exec_cmd(cmd_df) cmd_sys = "uname -a" exec_cmd(cmd_sys) end private def exec_cmd(cmd) r=IO.popen(cmd, "r") @result = r.readlines($/) r.close_read return @result end heres the index view <div class="body_top"> <%= render_parti...
2015 Apr 27
3
upssched setup
Hi Roger, I get: Apr 27 20:50:05 unifi upsmon[1022]: UPS ups on batteryApr 27 20:50:05 unifi upssched[2688]: Timer daemon startedApr 27 20:50:06 unifi upssched[2688]: New timer: onbatt (20 seconds)Apr 27 20:50:26 unifi upssched[2688]: Event: onbattApr 27 20:50:26 unifi upssched[2688]: exec_cmd(/sbin/upssched-cmd.sh onbatt) returned 126Apr 27 20:50:41 unifi upssched[2688]: Timer queue empty, exiting /etc/nut/upssched.conf CMDSCRIPT /sbin/upssched-cmd.shPIPEFN /etc/nut/upssched/upssched.pipeLOCKFN /etc/nut/upssched/upssched.lockAT ONBATT * START-TIMER onbatt 20AT ONLINE * CANCEL-TIMER onb...
2008 Jun 20
0
Is it possible to execute commands without allocate pty?
...ervers. Unfortunately I cannot execute commands after succesful login without allocate pty. My client send SSH_CMSG_EXEC_SHELL packet on server, but dont receive any answer. According RFC defined SSH1, server should send SSH_SMSG_SUCCESS or SSH_SMSG_FAILURE message. So I tried send SSH_CMSG_EXEC_CMD with command, but after executing command server send EXIT_STATUS message. I dont understand why, because RFC document define EXEC_CMD message this way: "Starts executing the given command, and enters interactive session mode." Would you please explain me why OpenSSH server doesnt...
2008 Mar 07
0
Piping logs to rotatelog
...me error. So I rolledup my sleeves and dig into: 1) /usr/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/lib/mongrel_cluster/init.rb 2) /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb I tried to re-built the log file name so on "1)" if passes and ARGV like: ##exec_cmd +=" -l #{port_log_file(port)}" exec_cmd +=" -l |/home/admin/rotatelogs #{port_log_file(port)} 30" but I get this: starting port 3001 mongrel_rails start -d -e production -p 3001 -P log/silvex.3001.pid -l |/home/admin/rotatelogs /var/log/my_mongrel3300.3001.log 30 ERROR...
2015 Apr 27
0
upssched setup
...; > Apr 27 20:50:05 unifi upsmon[1022]: UPS ups on battery > Apr 27 20:50:05 unifi upssched[2688]: Timer daemon started > Apr 27 20:50:06 unifi upssched[2688]: New timer: onbatt (20 seconds) > Apr 27 20:50:26 unifi upssched[2688]: Event: onbatt > Apr 27 20:50:26 unifi upssched[2688]: exec_cmd(/sbin/upssched-cmd.sh > onbatt) returned 126 > Apr 27 20:50:41 unifi upssched[2688]: Timer queue empty, exiting > > > /etc/nut/upssched.conf > > CMDSCRIPT /sbin/upssched-cmd.sh > PIPEFN /etc/nut/upssched/upssched.pipe > LOCKFN /etc/nut/upssched/upssched.lock > AT ONBAT...
2006 May 17
2
error handling in upssched.c
While looking into Laurent Lesage's problem with upssched, I noticed something in exec_cmd(): http://boxster.ghz.cc/projects/nut/browser/trunk/clients/upssched.c#L79 In the man pages for system(3) on both OS X and Linux (Debian sarge), I do not see any mention of errno being set. The error code is returned by system, and I am wondering if the "file not found" error that Laure...
2013 Apr 18
0
problem with a script via upssched-cmd
Hello I'm running a script via upssched on a onbatt event, I want to sent a email, shutdown a windows server and shutdown an ubuntu server When I run my script manually, all is ok but via upssched-cmd it return "exec_cmd returned 255" here is the script #!/bin/bash # send mail to admin echo "ECO" | mail -s "ARRET SERVEURS NON PRIORITAIRES" moi at domaine.fr net rpc shutdown -f -I ip_windows -U login%passwd ssh login at ip_ubuntu sudo shutdown -h now If I run only this cde net rpc shutdow...
2015 Apr 27
2
upssched setup
Roger, I did and it didnt work. Hence why I was trying to run just the shell script manually. I am not sure if this works though with the timer defined in it? Cheers, James Date: Mon, 27 Apr 2015 15:03:44 +0200 From: roger at rogerprice.org To: nut-upsuser at lists.alioth.debian.org Subject: Re: [Nut-upsuser] upssched setup On Mon, 27 Apr 2015, James Hammond wrote: > I am unable to get
2013 Apr 18
0
Nut-upsuser Digest, Vol 94, Issue 18
...st-etienne.archi.fr> Content-Type: text/plain; charset="utf-8" Hello I'm running a script via upssched on a onbatt event, I want to sent a email, shutdown a windows server and shutdown an ubuntu server When I run my script manually, all is ok but via upssched-cmd it return "exec_cmd returned 255" here is the script #!/bin/bash # send mail to admin echo "ECO" | mail -s "ARRET SERVEURS NON PRIORITAIRES" moi at domaine.fr net rpc shutdown -f -I ip_windows -U login%passwd ssh login at ip_ubuntu sudo shutdown -h now If I run only this cde net rpc shutdown...
2015 Apr 27
2
upssched setup
...05 unifi upsmon[1022]: UPS ups on battery > > Apr 27 20:50:05 unifi upssched[2688]: Timer daemon started > > Apr 27 20:50:06 unifi upssched[2688]: New timer: onbatt (20 seconds) > > Apr 27 20:50:26 unifi upssched[2688]: Event: onbatt > > Apr 27 20:50:26 unifi upssched[2688]: exec_cmd(/sbin/upssched-cmd.sh > > onbatt) returned 126 > > Apr 27 20:50:41 unifi upssched[2688]: Timer queue empty, exiting > > > > > > /etc/nut/upssched.conf > > > > CMDSCRIPT /sbin/upssched-cmd.sh > > PIPEFN /etc/nut/upssched/upssched.pipe > > LOCKFN...
2014 Apr 13
1
[PATCH] tools: Consolidate types.h
...nux/string.h -LIB_H += util/include/linux/types.h +LIB_H += ../include/linux/types.h LIB_H += util/include/linux/linkage.h LIB_H += util/include/asm/asm-offsets.h LIB_H += ../include/asm/bug.h @@ -252,7 +252,6 @@ LIB_H += util/event.h LIB_H += util/evsel.h LIB_H += util/evlist.h LIB_H += util/exec_cmd.h -LIB_H += util/types.h LIB_H += util/levenshtein.h LIB_H += util/machine.h LIB_H += util/map.h diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h index fc819ca34a7e..7df517acfef8 100644 --- a/tools/perf/arch/x86/include/perf_regs.h +++ b/tools/perf/a...
2014 Apr 13
1
[PATCH] tools: Consolidate types.h
...nux/string.h -LIB_H += util/include/linux/types.h +LIB_H += ../include/linux/types.h LIB_H += util/include/linux/linkage.h LIB_H += util/include/asm/asm-offsets.h LIB_H += ../include/asm/bug.h @@ -252,7 +252,6 @@ LIB_H += util/event.h LIB_H += util/evsel.h LIB_H += util/evlist.h LIB_H += util/exec_cmd.h -LIB_H += util/types.h LIB_H += util/levenshtein.h LIB_H += util/machine.h LIB_H += util/map.h diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h index fc819ca34a7e..7df517acfef8 100644 --- a/tools/perf/arch/x86/include/perf_regs.h +++ b/tools/perf/a...
2014 Apr 11
2
[PATCH] tools: Unify export.h
On Thu, Apr 10, 2014 at 07:38:05PM +0200, Borislav Petkov wrote: > Rebased onto current acme/perf/core: > > -- > From: Borislav Petkov <bp at suse.de> > Date: Sun, 23 Feb 2014 12:04:53 +0100 > Subject: [PATCH] tools: Unify export.h > > So tools/ has been growing three, at a different stage of their > development export.h headers and so we should unite into one.
2014 Apr 11
2
[PATCH] tools: Unify export.h
On Thu, Apr 10, 2014 at 07:38:05PM +0200, Borislav Petkov wrote: > Rebased onto current acme/perf/core: > > -- > From: Borislav Petkov <bp at suse.de> > Date: Sun, 23 Feb 2014 12:04:53 +0100 > Subject: [PATCH] tools: Unify export.h > > So tools/ has been growing three, at a different stage of their > development export.h headers and so we should unite into one.