Koozali.org: home of the SME Server

signal-event user-modify $account

Offline mahesaina

  • 4
  • +0/-0
signal-event user-modify $account
« on: July 28, 2011, 06:06:45 PM »
Hi,

i use smeserver 7.5.1,
and when i execute "signal-event user-modify accountKey" from shell
the exit status is 1.

but when i use server-manager for modify the user,
the report status is success.
Can anyone help me how to modify from shell?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: signal-event user-modify $account
« Reply #1 on: July 28, 2011, 06:20:16 PM »
and when i execute "signal-event user-modify accountKey" from shell
the exit status is 1.

Search for '|Status|' in /var/log/messages and you will identify which script or scripts in the user-modify event returned an error status, and you should also see some diagnostic messages as to what the error was.

Offline mahesaina

  • 4
  • +0/-0
Re: signal-event user-modify $account
« Reply #2 on: July 29, 2011, 05:04:54 AM »
Dear Charlie,,

i already check my /var/log/messages*, but i found no errors.
if execute directly from shell, no error message.
only occurs when i execute in the background, always give exit status 1.

have any idea?

Thanks.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: signal-event user-modify $account
« Reply #3 on: July 29, 2011, 09:10:36 AM »
Dear Charlie,,

i already check my /var/log/messages*, but i found no errors.
if execute directly from shell, no error message.
only occurs when i execute in the background, always give exit status 1.

have any idea?

Thanks.

please, define "I execute in the background", thank you

Offline mahesaina

  • 4
  • +0/-0
Re: signal-event user-modify $account
« Reply #4 on: July 29, 2011, 10:29:07 AM »

signal-event user-modify keyaccount

then the exit status is 1.

Thanks.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: signal-event user-modify $account
« Reply #5 on: July 29, 2011, 02:04:45 PM »
only occurs when i execute in the background, ...

Don't do that. You should wait until the command completes.

Offline mahesaina

  • 4
  • +0/-0
Re: signal-event user-modify $account
« Reply #6 on: July 29, 2011, 07:08:17 PM »
I still get the exit status = 1,
when using the script:

Unless (system ("signal-event user-modify $ keyaccount") == 0) {
     die "exit status 1";
}

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: signal-event user-modify $account
« Reply #7 on: July 29, 2011, 09:18:03 PM »
Code: [Select]
Unless (system ("signal-event user-modify $ keyaccount") == 0) {
     die "exit status 1";
}
Is the space between the $ and keyaccount the actual code or is that just a typo?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: signal-event user-modify $account
« Reply #8 on: July 29, 2011, 09:23:31 PM »
I still get the exit status = 1,
when using the script:

Unless (system ("signal-event user-modify $ keyaccount") == 0) {
     die "exit status 1";
}

Here you are printing '1' instead of the actual exit status of 'signal-event'. And you have a space between $ and keyaccount. 'unless' is a perl keyword, but 'Unless' is not.

Use instead:

Code: [Select]
die "signal-event returned non-zero" unless (system('signal-event', 'user-modify', '$keyaccount') == 0);

Use either:

'$keyaccount'

or

$keyaccount

depending on whether you wanted variable interpolation or literal '$keyaccount'.

Read 'man perlsec' (or http://perldoc.perl.org/perlsec.html).

Be sure to always check log files when you get an error from signal-event.

I'm bowing out now - this forum isn't intended to be a programming tutorial.