Opsi Product Updater

kwade
Beiträge: 5
Registriert: 10 Apr 2018, 10:06

Re: Opsi Product Updater

Beitragvon kwade » 19 Apr 2018, 09:46

Hello,
I am really interested in this method to update the opsi products I created like Firefox.
I installed opsi-updater but it looks for products that I do not install (I think it's the products that are with opsi-updater like install_firefox) and therefore no updates to my products.
How to adapt the program with my server opsi knowing that I use Opsi version 4.1?

I would really have your help please.

Have a good day.

islam
Beiträge: 79
Registriert: 19 Okt 2011, 12:08

Re: Opsi Product Updater

Beitragvon islam » 19 Apr 2018, 13:21

hello,

you would have to change the name of the product in the bash files to the exact name of the same product in your repository.
For example if your product is called "firefox", edit the bash file "internet_firefox.sh" and change the line that says prod_name="internet_firefox" to prod_name="firefox", you can also change the lang="de" to lang="en", if you want firefox in english.

Please note that there are some additional features of opsi updater, that work only if you use ini file database instead of mysql. (have to implement these later for mysql)
like setting the updated product action on setup for all clients which have it already installed and updating the product version in the database

you may also want to know that opsi updater will try to change the version number of the product in setup.ins file, which should contain this line:

Code: Alles auswählen

Set $ProductVersion$  = "52.7.3"

kwade
Beiträge: 5
Registriert: 10 Apr 2018, 10:06

Re: Opsi Product Updater

Beitragvon kwade » 19 Apr 2018, 14:31

Hello,
Thanks for your help.
In fact the problem is that opsi-updater tries to update products that I do not install As grafik_adobe_reader then I just install firefox.
here is the error he returns.

Code: Alles auswählen

OPSI Product Updates Checker


##########################################

[1]: Running: grafik_adobe_reader.sh
latest_available_version=1801120038
latest_version=1801120038
Latest available version: 1801120038 is an update package
Trying to get latest FULL Version...
latest_dot_minor_version=18.011.20038
test_major_version=1801120036
test_major_version=
test_major_version=1800920044
-rwxrwxr-x    1 ftp      ftp      120734192 Nov 14 05:19 AcroRdrDC1800920044_de_DE.exe
latest_major_version=1800920044
latest_dot_major_version=18.009.20044
[OPSI] [grafik_adobe_reader] checking for latest version...


LATEST-VERSION:   [1801120038]
OPSI-VERSION:   []

 Download Files from Official Server ? : [ y=Yes | n=No ]: [Default: y ] y
Downloading OPSI Files..

download_dir=/var/lib/opsi/depot/grafik_adobe_reader/files


04/19 14:03:22 [NOTICE] Downloading 1 item(s)
[#4f542f 0B/0B CN:1 DL:0B]                                                                                                                                                     
04/19 14:03:24 [NOTICE] GID#4f542f04a8e8fa85 - Download has already completed: /var/lib/opsi/depot/grafik_adobe_reader/files/AcroRdrDC1800920044_de_DE.exe

04/19 14:03:24 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/grafik_adobe_reader/files/AcroRdrDC1800920044_de_DE.exe

Résultats du téléchargement:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
4f542f|OK  |       0B/s|/var/lib/opsi/depot/grafik_adobe_reader/files/AcroRdrDC1800920044_de_DE.exe

Légende du statut:
(OK): téléchargement terminé.

04/19 14:03:24 [NOTICE] Downloading 1 item(s)
[#8acfd2 0B/0B CN:1 DL:0B]                                                                                                                                                     
04/19 14:03:27 [NOTICE] GID#8acfd2650b5717a1 - Download has already completed: /var/lib/opsi/depot/grafik_adobe_reader/files/AcroRdrDCUpd1801120038.msp

04/19 14:03:27 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/grafik_adobe_reader/files/AcroRdrDCUpd1801120038.msp

Résultats du téléchargement:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
8acfd2|OK  |       0B/s|/var/lib/opsi/depot/grafik_adobe_reader/files/AcroRdrDCUpd1801120038.msp

Légende du statut:
(OK): téléchargement terminé.
downloaded_file_major=
downloaded_file_minor=




 Update OPSI Version on Server ? : [ y=Yes | n=No ]: [Default: y ] ychown: groupe incorrect: « opsiconfd:opsifileadmins »
ProductMajorVersion NOT replaced in setup.ins
chown: groupe incorrect: « opsiconfd:opsifileadmins »
ProductMinorVersion NOT replaced in setup.ins
chown: groupe incorrect: « opsiconfd:opsifileadmins »
Update Package STILL DISABLED in setup.ins

#################################
#            #
# opsi-info version: 17.02.21   #
#            #
#   use -h for help      #
#            #
#################################

ERROR: no matching product found


###############################

process done.


##########################################

[2]: Running: internet_flashplayer.sh
[OPSI] [internet_flashplayer] checking for latest version...


04/19 14:03:58 [NOTICE] Downloading 1 item(s)
[#77c847 9.6MiB/19MiB(48%) CN:1 DL:10MiB ETA:1s]                                                                                                                               
04/19 14:03:59 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/internet_flashplayer/files/new_downloads/install_flash_player.exe

Résultats du téléchargement:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
77c847|OK  |    10MiB/s|/var/lib/opsi/depot/internet_flashplayer/files/new_downloads/install_flash_player.exe

Légende du statut:
(OK): téléchargement terminé.
/home/opsimaint/opsiupdater/trunk/version-current/prods/internet_flashplayer.sh: ligne 105: pev : commande introuvable

LATEST-VERSION:   []
OPSI-VERSION:   []
ERROR: Reading Official version failed.

##########################################

[3]: Running: office_libreoffice.sh
[OPSI] [office_libreoffice] checking for latest version...


LATEST-VERSION:   [6.0.3]
OPSI-VERSION:   []

Different Versions!
 Download Files from Official Server ? : [ y=Yes | n=No ]: [Default: y ] y
Downloading OPSI Files..

download_dir=/var/lib/opsi/depot/office_libreoffice/files


04/19 14:06:01 [NOTICE] Downloading 1 item(s)

04/19 14:06:01 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86.msi.meta4

04/19 14:06:01 [ERROR] CUID#10 - Download aborted. URI=http://ftp.free.fr/mirrors/documentfoundation.org/libreoffice/stable/6.0.3/win/x86/LibreOffice_6.0.3_Win_x86.msi
Exception: [AbstractCommand.cc:351] errorCode=8 URI=http://ftp.free.fr/mirrors/documentfoundation.org/libreoffice/stable/6.0.3/win/x86/LibreOffice_6.0.3_Win_x86.msi
  -> [HttpResponse.cc:86] errorCode=8 Invalid range header. Request: 126091264-189267967/252010496, Response: 0-252010495/252010496

[#43a84a 236MiB/240MiB(98%) CN:1 DL:8.3MiB]                                                                                                                                     
04/19 14:06:26 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86.msi

04/19 14:06:26 [NOTICE] La sauvegarde de la signature en tant que /var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86.msi.sig a echouée. Peut-être que le fichier existe déjà ?

Résultats du téléchargement:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
9872bc|OK  |   397KiB/s|/var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86.msi.meta4
43a84a|OK  |   9.8MiB/s|/var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86.msi

Légende du statut:
(OK): téléchargement terminé.

04/19 14:06:26 [NOTICE] Downloading 1 item(s)

04/19 14:06:26 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86_helppack_de.msi.meta4

04/19 14:06:27 [NOTICE] Téléchargement terminé: /var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86_helppack_de.msi

04/19 14:06:27 [NOTICE] La sauvegarde de la signature en tant que /var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86_helppack_de.msi.sig a echouée. Peut-être que le fichier existe déjà ?

Résultats du téléchargement:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
5d9bfa|OK  |   133KiB/s|/var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86_helppack_de.msi.meta4
2f108f|OK  |   9.9MiB/s|/var/lib/opsi/depot/office_libreoffice/files/LibreOffice_6.0.3_Win_x86_helppack_de.msi

Légende du statut:
(OK): téléchargement terminé.
 Update OPSI Version on Server ? : [ y=Yes | n=No ]: [Default: y ]
#################################
#            #
# opsi-info version: 17.02.21   #
#            #
#   use -h for help      #
#            #
#################################

ERROR: no matching product found


###############################

process done.


##########################################

[4]: Running: system_javavm.sh
[OPSI] [system_javavm] checking for latest version...

latest_version=8 Update 171

LATEST-VERSION:   [1.8.0.171]
OPSI-VERSION:   []

Different Versions!
 Download Files from Official Server ? : [ y=Yes | n=No ]: [Default: y ] ^X
No Files will be downloaded.


##########################################

[5]: Running: tools_classicshell.sh
[OPSI] [tools_classicshell] checking for latest version...


LATEST-VERSION:   [4.3.1]
OPSI-VERSION:   []

Different Versions!
 Download Files from Official Server ? : [ y=Yes | n=No ]: [Default: y ] ^C



Too bad for me because I use Mysql and so I can't move forward if I understand correctly?

Thanks again

kwade
Beiträge: 5
Registriert: 10 Apr 2018, 10:06

Re: Opsi Product Updater

Beitragvon kwade » 19 Apr 2018, 15:45

Hello Islam,
I solved this error because I changed the language in internet-firefox.sh in "en" English is why he could not read the product version and so I put it back in "de "German.
But the software binary file (.exe) are directly in / var / lib / opsi / depot / firefox and opsi-updater puts the .exe in / var / lib / opsi / depot / firefox / files and so the installation of the software can not succeed.
And also I had a version 59.0.2 but after the update I now have version 52.7.3 ;)

islam
Beiträge: 79
Registriert: 19 Okt 2011, 12:08

Re: Opsi Product Updater

Beitragvon islam » 19 Apr 2018, 16:07

you can still download the latest binaries even when using mysql.
you can only update software which are already available on your repo. if you want to exclude some products from updating rename the .sh file to .s_ for example

kwade
Beiträge: 5
Registriert: 10 Apr 2018, 10:06

Re: Opsi Product Updater

Beitragvon kwade » 20 Apr 2018, 13:04

Hello,
Thank you again for your help.
After the update I noticed that in the setup script, opsi-updater modifies the declaration of the variable ProductVersion. and also erases.
Before setup script was this

Code: Alles auswählen

DefVar $ProductVersion$
   
   Set $ProductVersion$  = "59.0.2"


And after, I found

Code: Alles auswählen

 DefVar $ProductVersion= "52.7.3"

And after that it installs on the clients that have the previous version but the installation fails because the setup script has an error.
How can I do to change this?

islam
Beiträge: 79
Registriert: 19 Okt 2011, 12:08

Re: Opsi Product Updater

Beitragvon islam » 20 Apr 2018, 17:03

you can send me your setup script, so I can check it. otherwise you can use the setup script i made, it can be found in the folder "setup_scripts" or here: https://sourceforge.net/p/opsiupdater/code-0/HEAD/tree/trunk/version-current/setup-scripts/internet_firefox/