Bug 23005 - Verwendung von "source" in Shellskripten
Summary: Verwendung von "source" in Shellskripten
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: General
Version: UCS 3.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 3.0 - MS1
Assignee: Sönke Schwardt-Krummrich
QA Contact: Alexander Kläser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 13:41 CEST by Sönke Schwardt-Krummrich
Modified: 2011-12-13 15:50 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2011-07-12 13:41:43 CEST
In diversen Shellskripten / init.d-Skripten (auch via Patch) wird 
"source $FILE"  statt ". $FILE" verwendet. Da während der Installation zeitweise nur die dash installiert ist, funktionieren diese Skripte nicht zuverlässig und führen zu Folgefehlern. Siehe unten:


Setting up apache2-mpm-prefork (2.2.16-6.61.201105201555) ...
Starting web server: apache2/etc/init.d/apache2: 286: source: not found
invoke-rc.d: initscript apache2, action "start" failed.
Setting up apache2 (2.2.16-6.61.201105201555) ...


Setting up postgresql-common (113.14.201105251424) ...
supported_versions: WARNING: lsb_release not present, unknown distribution
Adding user postgres to group ssl-cert
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
/etc/init.d/postgresql: 49: source: not found
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-common (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up locales (2.11.2-10.7.201104250653) ...
configured to not write apport reports



Setting up libapache2-mod-auth-pam (1.1.1-8.23.201104230055) ...
Reloading web server config: apache2
Setting up univention-apache (5.0.1-2.128.201106161552) ...
File: /etc/apache2/mods-available/ssl.conf
File: /etc/default/apache2
File: /etc/apache2/sites-available/default
Multifile: /var/www/ucs-overview/en.html
Multifile: /var/www/ucs-overview/de.html
File: /etc/apache2/ports.conf
File: /etc/apache2/mods-available/proxy.conf
Module: extension
Module auth_pam already enabled
Enabling module unique_id.
Run '/etc/init.d/apache2 restart' to activate new configuration!
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
Module ssl already disabled
Enabling module ssl.
See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.
Run '/etc/init.d/apache2 restart' to activate new configuration!
Create apache2/autostart
File: /etc/default/apache2
File: /etc/default/apache2
Create apache2/loglevel
File: /etc/apache2/sites-available/default
File: /etc/apache2/sites-available/default
Create apache2/startsite
File: /etc/apache2/sites-available/default
File: /etc/apache2/sites-available/default
Create apache2/documentroot
File: /etc/apache2/sites-available/default
File: /etc/apache2/sites-available/default
Create apache2/maxclients
File: /etc/apache2/sites-available/default
File: /etc/apache2/sites-available/default
Create mail/alias/webmaster
The server has not joined yet
[: 77: no: unexpected operator
Module ssl disabled.
Run '/etc/init.d/apache2 restart' to activate new configuration!
Stopping web server: apache2.
Starting web server: apache2/etc/init.d/apache2: 286: source: not found
Setting up univention-management-console-server (4.0.41-1.501.201107011720) ...
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2011-07-13 12:12:04 CEST
Folgende Patches wurden angepasst:

amavisd-new/3.0-0-0-ucs/1:2.6.4-3/00-autostart-setting.patch
apache2/3.0-0-0-ucs/2.2.16-6/00-autostart-setting.patch
cups/3.0-0-0-ucs/1.4.4-7/00-autostart-setting.patch
postgresql-common/3.0-0-0-ucs/113/01-autostart-setting.patch
samba/3.0-0-0-ucs/2:3.6.0~rc1-2/11_winbind_init.d.script.patch
samba/3.0-0-0-ucs/2:3.6.0~rc2-0/11_winbind_init.d.script.patch
spamassassin/3.0-0-0-ucs/3.3.1-1/00-autostart-setting.patch

Die entsprechenden Pakete wurden neu gebaut.
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2011-07-13 12:16:01 CEST
Im SVN wurde explizit nach "source " in Shell-Skripten gesucht. Es wurde dann das gesamte Paket nach bashisms geprüft und ggf. korrigiert.
Liste der geänderten Dateien:

ucs/base/univention-heimdal/conffiles/etc/init.d/heimdal-kdc
ucs/base/univention-ssl/gencertificate.py
ucs/desktop/univention-gdm/conffiles/etc/init.d/gdm
ucs/desktop/univention-gdm/univention/Linux-Arbeitsplatz
ucs/management/univention-directory-listener/debian/univention-directory-listener.init
ucs/management/univention-ldap/10univention-ldap-server.inst
ucs/management/univention-ldap/conffiles/init.d/slapd
ucs/management/univention-ldap/debian/control
ucs/management/univention-ldap/debian/univention-ldap-server.postinst
ucs/nagios/univention-nagios/conffiles/etc/init.d/nagios-nrpe-server
ucs/nagios/univention-nagios/conffiles/etc/init.d/nagios3
ucs/nagios/univention-nagios/usr/lib/nagios/plugins/check_univention_printerqueue
ucs/packaging/univention-package-template/debian/univention-package-template.postinst
ucs/services/univention-ad-connector/debian/univention-ad-connector.init
ucs/services/univention-bind/05univention-bind.inst
ucs/services/univention-bind/debian/univention-bind-proxy.init
ucs/services/univention-bind/debian/univention-bind-proxy.postinst
ucs/services/univention-bind/debian/univention-bind.init
ucs/services/univention-bind/debian/univention-bind.postinst
ucs/services/univention-dhcp/debian/univention-dhcp.init
ucs/services/univention-s4-connector/97univention-s4-connector.inst
ucs/services/univention-s4-connector/debian/univention-s4-connector.init
ucs/services/univention-samba/26univention-samba.inst
ucs/services/univention-samba/conffiles/etc/init.d/samba
ucs/services/univention-samba/debian/postinst
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2011-07-29 16:20:12 CEST
Die jeweiligen Pakete wurden angepasst und neu gebaut.
Changelogeintrag nicht notwendig, da erst Fehler zur 3.0 aufgetreten ist.
Comment 4 Alexander Kläser univentionstaff 2011-08-11 16:52:35 CEST
Installation
→ OK, der String "source: not found" konnte nach einer Installation in keinen Log-Dateien mehr gefunden werden.


(In reply to comment #1)
> Folgende Patches wurden angepasst:
> 
> amavisd-new/3.0-0-0-ucs/1:2.6.4-3/00-autostart-setting.patch
> apache2/3.0-0-0-ucs/2.2.16-6/00-autostart-setting.patch
> cups/3.0-0-0-ucs/1.4.4-7/00-autostart-setting.patch
> postgresql-common/3.0-0-0-ucs/113/01-autostart-setting.patch
> samba/3.0-0-0-ucs/2:3.6.0~rc1-2/11_winbind_init.d.script.patch
> samba/3.0-0-0-ucs/2:3.6.0~rc2-0/11_winbind_init.d.script.patch
> spamassassin/3.0-0-0-ucs/3.3.1-1/00-autostart-setting.patch
> 
> Die entsprechenden Pakete wurden neu gebaut.

→ OK, es konnten keine weiteren Vorkommnisse von "source" in 3.0-Patches gefunden werden.


(In reply to comment #2)
> Im SVN wurde explizit nach "source " in Shell-Skripten gesucht. Es wurde dann
> das gesamte Paket nach bashisms geprüft und ggf. korrigiert.

→ FEHLER, es wurden noch zusätzliche Dateien gefunden (via "grep -rE '^\s*source'"), in denen "source" vorkommt:

mail/univention-mail-postfix/conffiles/etc/init.d/postfix
desktop/univention-ooffice2/ooweb
desktop/univention-ooffice2/oobase
desktop/univention-ooffice2/oofromtemplate
desktop/univention-ooffice2/ooo-wrapper
desktop/univention-ooffice2/oodraw
desktop/univention-ooffice2/ooffice
desktop/univention-ooffice2/oocalc
desktop/univention-ooffice2/ooimpress
desktop/univention-ooffice2/oomath
desktop/univention-ooffice2/oowriter
packaging/ucslint/testframework/0010-2-3-4-5/univention-certificate
packaging/ucslint/testframework/0013-2.correct
packaging/ucslint/testframework/0013-2/univention-certificate
packaging/ucslint/testframework/0011-2-3-4-5-6-7-8/univention-certificate


(In reply to comment #3)
> Die jeweiligen Pakete wurden angepasst und neu gebaut.
> Changelogeintrag nicht notwendig, da erst Fehler zur 3.0 aufgetreten ist.

→ Da es sich um eine Änderung am Code handelt, sollte dies nichtdestotrotz im Changelog dokumentiert werden. Dies kann zusammen mit Bug #22557 geschehen.
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2011-09-22 15:24:08 CEST
(In reply to comment #4)
> (In reply to comment #2)
> > Im SVN wurde explizit nach "source " in Shell-Skripten gesucht. Es wurde dann
> > das gesamte Paket nach bashisms geprüft und ggf. korrigiert.
> 
> → FEHLER, es wurden noch zusätzliche Dateien gefunden (via "grep -rE
> '^\s*source'"), in denen "source" vorkommt:
> 
> mail/univention-mail-postfix/conffiles/etc/init.d/postfix

Das war eine Work-In-Progress-Version. "source" ist nicht mehr vorhanden.

> desktop/univention-ooffice2/ooweb
> desktop/univention-ooffice2/oobase
> desktop/univention-ooffice2/oofromtemplate
> desktop/univention-ooffice2/ooo-wrapper
> desktop/univention-ooffice2/oodraw
> desktop/univention-ooffice2/ooffice
> desktop/univention-ooffice2/oocalc
> desktop/univention-ooffice2/ooimpress
> desktop/univention-ooffice2/oomath
> desktop/univention-ooffice2/oowriter

Problematische Stellen sind nicht mehr enthalten.

> packaging/ucslint/testframework/0010-2-3-4-5/univention-certificate
> packaging/ucslint/testframework/0013-2.correct
> packaging/ucslint/testframework/0013-2/univention-certificate
> packaging/ucslint/testframework/0011-2-3-4-5-6-7-8/univention-certificate

Wurde korrigiert.

> (In reply to comment #3)
> > Die jeweiligen Pakete wurden angepasst und neu gebaut.
> > Changelogeintrag nicht notwendig, da erst Fehler zur 3.0 aufgetreten ist.
> 
> → Da es sich um eine Änderung am Code handelt, sollte dies nichtdestotrotz im
> Changelog dokumentiert werden. Dies kann zusammen mit Bug #22557 geschehen.

Hinweis bzgl. Changelogeintrag am Bug 22557 ist vorhanden.
Comment 6 Alexander Kläser univentionstaff 2011-09-23 17:49:31 CEST
(In reply to comment #5)
> ...
> Das war eine Work-In-Progress-Version. "source" ist nicht mehr vorhanden.
> ...
> Problematische Stellen sind nicht mehr enthalten.
> ...
> Wurde korrigiert.

OK

(In reply to comment #5)
> Hinweis bzgl. Changelogeintrag am Bug 22557 ist vorhanden.

OK

→ VERIFIED
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2011-12-13 15:50:39 CET
UCS 3.0-0 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte dieser Bug dupliziert
werden: "Clone This Bug"