Modify opsipxeconfd

Antworten
o.ferre
Beiträge: 64
Registriert: 19 Nov 2010, 13:58
Wohnort: LYON - France

Modify opsipxeconfd

Beitrag von o.ferre »

Hi,

with older version of opsi, I modified the /usr/bin/opsipxeconfd file to call a perl script.

With the new version, i'm not sure this run correctly.


In the old version, this is my opsipxeconfd file :

Code: Alles auswählen

def updateBootConfiguration(self, hostId):
                try:
                        hostId = forceHostId(hostId)
                        logger.info(u"Updating PXE boot configuration for host '%s'" % hostId)

                        # Remove current pxe config for host
                        currentPcws = []
                        self._pxeConfigWritersLock.acquire()
                        try:
                                for pcw in self._pxeConfigWriters:
                                        if (pcw.hostId == hostId):
                                                currentPcws.append(pcw)
                                for pcw in currentPcws:
                                        self._pxeConfigWriters.remove(pcw)
                        finally:
                                self._pxeConfigWritersLock.release()
                        for pcw in currentPcws:
                                pcw.stop()
                                while pcw.isAlive():
                                        time.sleep(0.1)
                                logger.notice(u"PXE boot configuration for host '%s' removed" % hostId)
                        # Suppression de la liste des paquets FUSION
                        subprocess.call(["/path_to_perl_script.pl", hostId])
I would like to call this script at beginning of opsi (perhaps I got to modify /usr/lib/opsipxeconfd/opsipxeconfd.py or opsipxeconfdinit.py ? OR is there another way to execute script at the beginning of opsi process ?

Version of OPSI : 4.2.0.3

I used OPSI only for deploy OS by pxe boot.

Thanks for the help
Olivier
O.Ferre
ENS de Lyon
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1517
Registriert: 10 Jun 2015, 12:19

Re: Modify opsipxeconfd

Beitrag von m.radtke »

Hi Olivier,

what does this script do?

The current opsipxeconfd is build as a binary and you cannot edit it anymore.

When you tell us what this script did, maybe someone may have another idea how ti implement this into opsi.

Regards

Mathias
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
o.ferre
Beiträge: 64
Registriert: 19 Nov 2010, 13:58
Wohnort: LYON - France

Re: Modify opsipxeconfd

Beitrag von o.ferre »

Hi Mathias,
Thanks for your answer. The script make a connection to a GLPI database to remove the packages list of a computer.
After this, a postinst script install the fusioninventory agent on the computer and execute a contact.

This script is useful in case of reinstallation of computer and to make install faster.
Well, I can do this in powershell in a postinst script too... but I have to write it ! :-)

Olivier
O.Ferre
ENS de Lyon
o.ferre
Beiträge: 64
Registriert: 19 Nov 2010, 13:58
Wohnort: LYON - France

Re: Modify opsipxeconfd

Beitrag von o.ferre »

Hi,

to be more precise, I would like to execute a script during the execution of opsi linux boot image
https://ibb.co/qkB6kmC
And after fill in the HostID.

Olivier
O.Ferre
ENS de Lyon
Antworten