How to add a delay when requiring a shutdown of a client ?

Antworten
nicolaslebrun
Beiträge: 107
Registriert: 18 Apr 2011, 11:43

How to add a delay when requiring a shutdown of a client ?

Beitrag von nicolaslebrun »

Hi,

When you shutdown a client from Configed, the halt of the machine is really sudden and don't warn the connected user.

Is there a confg I miss ?

I tried adding
opsiclientd.event_default.shutdown_user_cancelable [1]
opsiclientd.event_default.shutdown_warning_time [60]
to the general config, but those variables don't affect the "shudown" action.

Is there a config on server side ? Am i missing something ?

Regards,
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: How to add a delay when requiring a shutdown of a client ?

Beitrag von n.wenselowski »

Hi,

shutting down from the configed does not trigger an event but instead triggers a direct shutdown action.
Have you had a look at the shutdownwanted package? This may do what you want.


Kind regards

Niko

Code: Alles auswählen

import OPSI
nicolaslebrun
Beiträge: 107
Registriert: 18 Apr 2011, 11:43

Re: How to add a delay when requiring a shutdown of a client ?

Beitrag von nicolaslebrun »

Thanks Niko for this reply...

My problem is that i need to perform actions at shutdown... not only shutdown the computer. If i use shutdownwanted, and if there is any other package scheduled (setup in configed), it will launch actions without informing the user...

So, my idea was to add a package named actionsWanted.opsi with a high priority (95) that would ask for the user if he wants to let the localboot products to be installed... The package i have launches an autoit script that ask a question, minimize notifier.exe and winst.exe and pauses the execution of localboot setup.

But that's not very fine...

I found on the wiki a post where Dark Alex talks about
an event "request_graceful_reboot" which issues a popup requesting the user to reboot

viewtopic.php?f=7&t=8271&p=36087#p36087

That's why, i am wondering whether it is possible to add an event in opsiclientd "request_actions_launch" for example ?

Regards,

Nico
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: How to add a delay when requiring a shutdown of a client ?

Beitrag von n.wenselowski »

Hi,

from what you describe I'd probably make use of shutdownwanted and the just configure opsiclientd to show a warning - this is the setting action_warning_time of an event.
If you do not want all your actions to show the warning you'd make your own event - this is probably what Dark Alex did.
What actions can be launched in the client list in configed can be configured in the host parameters.

Kind regards

Niko

Code: Alles auswählen

import OPSI
nicolaslebrun
Beiträge: 107
Registriert: 18 Apr 2011, 11:43

Re: How to add a delay when requiring a shutdown of a client ?

Beitrag von nicolaslebrun »

Hi Niko,

Thanks for your reply !

In the manual, i can read
To incorporate additional events (which should be configured in the opsiclientd.conf) into the submenu you have to edit the config configed.opsiclientd_events via the tab (server) host parameters.
But it seems the property is not multivalue.

Code: Alles auswählen

opsi-admin -d method config_getObjects [] '{"id" : "configed.opsiclientd_events"}'
[
    {
    "ident" : "configed.opsiclientd_events",
    "description" : "",
    "defaultValues" :
        [
        "on_demand"
        ],
    "editable" : true,
    "multiValue" : false,
    "possibleValues" :
        [
        "launch_update_and_extinction",
        "on_demand"
        ],
    "type" : "UnicodeConfig",
    "id" : "configed.opsiclientd_events"
    }
]
Am i missing something ?

For the moment, i'll try to see if i can manage with 'action_warning_time' only !

I'll be back

Regards,

Nico
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: How to add a delay when requiring a shutdown of a client ?

Beitrag von n.wenselowski »

Hi,

it should be multivalue.
Don't know where this comes from, maybe from an early testing version.
It probably is the easiest way to make it multivalue.


Bye

Niko

Code: Alles auswählen

import OPSI
Antworten