Extra "fi" in /etc/init.d/gdm

Bug #1315442 reported by Owen Dunn
58
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Ubuntu GNOME
Fix Released
Low
Unassigned
gdm (Ubuntu)
Fix Released
Low
Unassigned
Trusty
Fix Released
Low
Unassigned
Utopic
Won't Fix
Low
Unassigned

Bug Description

Ubuntu release 14.04 LTS
gdm 3.10.0.1-0ubuntu3

I just tried to start gdm with "/etc/init.d/gdm start " and got the message:

/etc/init.d/gdm: 79: /etc/init.d/gdm: Syntax error: "fi" unexpected (expecting "}")

I'm aware of service(8) but cjwatson said I should report this as a bug anyway!

Owen

SRU Information:

[Impact]

 * Anyone who tries to use the sysv style /etc/init.d/gdm script to control
   gdm may get a syntax error which disallows the script from running,
   bombing out to the command line with an unfriendly error

 * This problem effects vivid, utopic and trusty. Without this fix
   backported, the functionality of the sysv style script for controlling
   the gdm service is broken under certain circumstances. The resulting
   unfriendly error is also unprofessional and gives a feeling of
   brokenness to Ubuntu in all three of these releases, including the
   ones to be backported to.

 * This upload is a series of three patches. The syntax error
   results from a single line in each of the debian/gdm.init files which get
   installed as the /etc/init.d/gdm shell script. The problem is an extra
   unmatched "fi" that results in a syntax error if the corresponding line
   is interpreted

[Test Case]

 * To test the fix in vivid, type the following commands before and after
   the updated package is installed:

   cd /etc/init.d
   sudo ./gdm

   If the script exits with a syntax error before the package with
   the fix is installed, you have verified the bug.

   If the script exits with a syntax error after the package is installed,
   the fix did not work.
   If the script does not indicate a syntax error after the package
   is installed, the fix worked

   To test the fix on utopic, do the identical test as in vivid above
   but instead use the following single command to invoke the script:

   sudo /etc/init.d/gdm

   To test the fix on trusty, do the test as in vivid and utopic,
   but use the following commands to change directories and invoke
   the script:

   cd /etc/init.d
   sudo ./gdm
   sudo ./gdm start

   In this case, both times you run the script it should exit with
   the syntax error before installing the package and neither time
   after installing the package.

[Regression Potential]

 * Any scripts which may call this script which happen to mistakenly
   rely on it to fail could perhaps behave differently, with unknown
   results possible

[Other Info]

 * Using or not using sudo before each command may affect the tests
   with varying output that may be unexpected. In all cases, however,
   if the script bombs on a syntax error happens mentioning a line number
   and "fi" the test definitely either verified the bug or definitively
   showed the package did not fix the bug (or was not installed correctly).

   A situation which arose during the testing is that depending on the
   whether the patch is on vivid, utopic or trusty, calling the script
   in different ways (fully qualified path vs. changing the current
   directory to /etc/init.d and using ./gdm, for instance, or
   including or not including the 'start' parameter) causes the
   test to behave differently, for instance failing silently or working
   depending on how the script is called even with the syntax error present.
   This is why there are different command lines for each version of the
   patch for testing.

   I did some tracing on why this happened, and the reasons seem buried deep
   within the trees of scripts called beneath /etc/init.d/gdm and are outside
   the scope of this fix and do not invalidate this fix. This fix deals
   with a simple top level shell script syntax error that can be successfully
   tested for as indicated above.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Evan Wiley (evanwiley) wrote :

Goto line 79 and comment out the extra fi. all works good after

Revision history for this message
kira (pphi-bb10) wrote :

how can i goto line. i dont see any number :(

Revision history for this message
Cheddie Merai (cheddiemerai) wrote :

Do sudo gedit /etc/init.d/gdm then look at the bottom of the gedit window where you see sh, Tab Width, Ln. That's what you're looking for "Ln" which means line number.

Revision history for this message
Juan Pablo (juanps90) wrote :

The solution proposed by #2 indeed works.

Tim Lunn (darkxst)
Changed in ubuntu-gnome:
milestone: none → vivid
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm (Ubuntu Trusty):
status: New → Confirmed
Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote :

I have made a fix for this bug and attached it as a debdiff to this comment:

This is a very simple change to the code in debian/gdm.init - I remove line 73 which has an extra unmatched "fi"

Tested as follows:
Built binaries using sbuild in latest vivid environment on a trusty machine. Fired up an Ubuntu-Gnome vivid daily build (current for 4/2/2015) LiveCD in a virtual machine. Verified the bug failure on the plain vanilla vivid LiveCD as follows:

cd /etc/init.d
./gdm

Could not get the failure with "./gdm start" like mentioned in the bug report - had to leave out "start"

Copied all the .deb files from the vivid sbuild on the trusty machine onto the Ubuntu-Gnome vivid vm. Installed the four .deb files using "dpkg -i ..." Install succeeded, and visually inspecting /etc/init.d/gdm showed line 73 was indeed removed. Typed:

cd /etc/init.d
./gdm

At the command prompt and got no error about "fi" - just showed the informational message about usage (because I left out "start"). This confirms that the bug is fixed for the current version of vivid.

Adam Conrad (adconrad)
tags: added: patch
Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote :

The fix in comment #7 was for vivid specifically. I will be creating debdiff patches for trusty and utopic as well

Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote :

I have made a fix (patch) for this bug for trusty, tested on Ubuntu-Gnome trusty and attached it as trusty-gdm_3.10.0.1-0ubuntu3.2.debdiff to this comment:

This is a very simple change to the code in debian/gdm.init - I removed line 78 which has an extra unmatched "fi"

Tested as follows:
Built binaries using sbuild in latest trusty environment on a trusty machine. Fired up an Ubuntu-Gnome trusty 14.04.2 release build LiveCD in a virtual machine. Verified the bug failure on the plain vanilla vivid LiveCD as follows:

cd /etc/init.d
./gdm
(gave syntax error)
./gdm start
(gave syntax error)

Copied all the .deb files from the trusty sbuild on the trusty build machine onto the Ubuntu-Gnome trusty livecd vm. Installed the four .deb files using "dpkg -i ..." Install succeeded, and visually inspecting /etc/init.d/gdm showed original line 78 was indeed removed. Typed:

cd /etc/init.d
./gdm
(worked as expected - no syntax error)
./gdm start
(worked as expected - no syntax error)

This confirms that the bug fix works for the 14.04.2 release version of Ubuntu-Gnome.

Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote :

I have made a fix (patch) for this bug for utopic, tested on Ubuntu-Gnome utopic and attached it as gdm_3.10.0.1-0ubuntu7.2.debdiff to this comment:

This is a very simple change to the code in debian/gdm.init - I removed line 78 which has an extra unmatched "fi"

Tested as follows:
Built binaries using sbuild in latest utopic environment on a trusty machine. Fired up an Ubuntu-Gnome utopic 14.10 release build LiveCD in a virtual machine. Verified the bug failure on the plain vanilla utopic LiveCD as follows:

/etc/init.d/gdm
(gave syntax error)

If I changed directories to /etc/init.d and did "./gdm" the script did not do anything - just returned. Also, "/etc/init.d/gdm start" worked fine. Still, the error did occur as indicated above.

Copied all the .deb files from the utopic sbuild on the trusty build machine onto the Ubuntu-Gnome utopic livecd vm. Installed the four .deb files using "dpkg -i ..." Install succeeded, and visually inspecting /etc/init.d/gdm showed original line 78 was indeed removed. Typed:

/etc/init.d/gdm
(worked as expected - no syntax error)
/etc/init.d/gdm start
(worked as expected - no syntax error)

This confirms that the bug fix works for the 14.10 utopic release version of Ubuntu-Gnome.

Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote :

I uploaded a wrong debdiff in the previous comment as a patch (#10). Included in this comment is the correct patch for the comment #10.

Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote :

I somehow must have deleted the vivid patch referenced in the fix in comment #7 above. I have attached it here: vivid-gdm_3.14.1-0ubuntu3.debdiff

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm - 3.14.1-0ubuntu3

---------------
gdm (3.14.1-0ubuntu3) vivid; urgency=medium

  * debian/gdm.init - removed extra unmatched "fi" line 73 (LP: #1315442)
 -- Scott Sanbar <email address hidden> Thu, 02 Apr 2015 17:39:18 -0500

Changed in gdm (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Tim Lunn (darkxst) wrote :

Thanks for the fix Scott!

 I have uploaded to trusty and utopic, please add the SRU paperwork when you can.

Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Owen, or anyone else affected,

Accepted gdm into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdm/3.10.0.1-0ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gdm (Ubuntu Trusty):
status: Confirmed → Fix Committed
tags: added: verification-needed
Changed in gdm (Ubuntu Utopic):
status: New → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Owen, or anyone else affected,

Accepted gdm into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdm/3.10.0.1-0ubuntu7.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
not-used-anymore (not-used-anymore-deactivatedaccount) wrote : Re: [Bug 1315442] Re: Extra "fi" in /etc/init.d/gdm

No problem - what about vivid?

Thanks! I had fun!

Scott

On Fri, Apr 3, 2015 at 7:44 PM, Tim <email address hidden> wrote:

> Thanks for the fix Scott!
>
> I have uploaded to trusty and utopic, please add the SRU paperwork when
> you can.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1315442
>
> Title:
> Extra "fi" in /etc/init.d/gdm
>
> Status in Ubuntu GNOME:
> New
> Status in gdm package in Ubuntu:
> Fix Released
> Status in gdm source package in Trusty:
> Confirmed
> Status in gdm source package in Utopic:
> New
>
> Bug description:
> Ubuntu release 14.04 LTS
> gdm 3.10.0.1-0ubuntu3
>
> I just tried to start gdm with "/etc/init.d/gdm start " and got the
> message:
>
> /etc/init.d/gdm: 79: /etc/init.d/gdm: Syntax error: "fi" unexpected
> (expecting "}")
>
> I'm aware of service(8) but cjwatson said I should report this as a
> bug anyway!
>
> Owen
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu-gnome/+bug/1315442/+subscriptions
>

description: updated
Tim Lunn (darkxst)
Changed in ubuntu-gnome:
milestone: vivid → trusty.3
Mathew Hodson (mhodson)
tags: added: trusty
Revision history for this message
Brian Murray (brian-murray) wrote :

The fix has already been released in Vivid.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [gdm/trusty] possible regression found

As a part of the Stable Release Updates quality process a search for Launchpad bug reports using the version of gdm from trusty-proposed was performed and bug 1472341 was found. Please investigate this bug report to ensure that a regression will not be created by this SRU. In the event that this is not a regression remove the "verification-failed" tag from this bug report and tag 1472341 "bot-stop-nagging". Thanks!

tags: added: verification-failed
Revision history for this message
Tim Lunn (darkxst) wrote :

the above issue is not related to the fix in this sru

tags: removed: verification-failed
Mathew Hodson (mhodson)
Changed in gdm (Ubuntu Utopic):
status: Fix Committed → Won't Fix
importance: Undecided → Low
Changed in gdm (Ubuntu Trusty):
importance: Undecided → Low
Changed in gdm (Ubuntu):
importance: Undecided → Low
Revision history for this message
Bruce Pieterse (octoquad) wrote :

I asked the reporter in bug #1472341 to provide an update on the failed package installation. Is there any reason this fix has not been released to Trusty yet?

Changed in ubuntu-gnome:
status: New → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote :

Because nobody seems to have verified the fix in Trusty.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [gdm/trusty] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for trusty for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Tim Lunn (darkxst) wrote :

tested gdm from proposed on up to date trusty, and gdm starts as expected with starting with "/etc/init.d/gdm start"

tags: added: verification-done
removed: removal-candidate verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm - 3.10.0.1-0ubuntu3.2

---------------
gdm (3.10.0.1-0ubuntu3.2) trusty; urgency=medium

  * debian/gdm.init - removed extra unmatched "fi" line 78 (LP: #1315442)
 -- Scott Sanbar <email address hidden> Fri, 03 Apr 2015 05:03:26 -0500

Changed in gdm (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for gdm has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in ubuntu-gnome:
status: Triaged → Fix Released
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.