Extra "fi" in /etc/init.d/gdm
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Ubuntu GNOME |
Low
|
Unassigned | ||
| | gdm (Ubuntu) |
Low
|
Unassigned | ||
| | Trusty |
Low
|
Unassigned | ||
| | Utopic |
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.
| Evan Wiley (evanwiley) wrote : | #2 |
Goto line 79 and comment out the extra fi. all works good after
| kira (pphi-bb10) wrote : | #3 |
how can i goto line. i dont see any number :(
| Cheddie Merai (cheddiemerai) wrote : | #4 |
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.
| Juan Pablo (juanps90) wrote : | #5 |
The solution proposed by #2 indeed works.
| Changed in ubuntu-gnome: | |
| milestone: | none → vivid |
| Launchpad Janitor (janitor) wrote : | #6 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in gdm (Ubuntu Trusty): | |
| status: | New → Confirmed |
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.
| tags: | added: patch |
The fix in comment #7 was for vivid specifically. I will be creating debdiff patches for trusty and utopic as well
I have made a fix (patch) for this bug for trusty, tested on Ubuntu-Gnome trusty and attached it as trusty-
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.
I have made a fix (patch) for this bug for utopic, tested on Ubuntu-Gnome utopic and attached it as gdm_3.10.
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.
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.
I somehow must have deleted the vivid patch referenced in the fix in comment #7 above. I have attached it here: vivid-gdm_
| Launchpad Janitor (janitor) wrote : | #13 |
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 |
| Tim (darkxst) wrote : | #14 |
Thanks for the fix Scott!
I have uploaded to trusty and utopic, please add the SRU paperwork when you can.
Hello Owen, or anyone else affected,
Accepted gdm into trusty-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
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-
Further information regarding the verification process can be found at https:/
| Changed in gdm (Ubuntu Trusty): | |
| status: | Confirmed → Fix Committed |
| tags: | added: verification-needed |
| Changed in gdm (Ubuntu Utopic): | |
| status: | New → Fix Committed |
| Adam Conrad (adconrad) wrote : | #16 |
Hello Owen, or anyone else affected,
Accepted gdm into utopic-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
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-
Further information regarding the verification process can be found at https:/
| Scott Sanbar (aeoril-deactivatedaccount) wrote : Re: [Bug 1315442] Re: Extra "fi" in /etc/init.d/gdm | #17 |
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:/
>
> 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:/
>
| description: | updated |
| Changed in ubuntu-gnome: | |
| milestone: | vivid → trusty.3 |
| tags: | added: trusty |
| Brian Murray (brian-murray) wrote : | #18 |
The fix has already been released in Vivid.
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-
| tags: | added: verification-failed |
| Tim (darkxst) wrote : | #20 |
the above issue is not related to the fix in this sru
| tags: | removed: verification-failed |
| 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 |
| Bruce Pieterse (octoquad) wrote : | #21 |
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 |
| Brian Murray (brian-murray) wrote : | #22 |
Because nobody seems to have verified the fix in Trusty.
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 |
| Tim (darkxst) wrote : | #24 |
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 |
| Launchpad Janitor (janitor) wrote : | #25 |
This bug was fixed in the package gdm - 3.10.0.1-0ubuntu3.2
---------------
gdm (3.10.0.
* 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 |
| Chris J Arges (arges) wrote : Update Released | #26 |
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 |


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