[mythtv-commits] Ticket #13256: mythtv-setup Xubuntu 18.04
MythTV
noreply at mythtv.org
Tue May 15 22:02:55 UTC 2018
#13256: mythtv-setup Xubuntu 18.04
----------------------------------+------------------------------
Reporter: mike.bibbings@… | Owner: (none)
Type: Bug Report - General | Status: new
Priority: minor | Milestone: needs_triage
Component: Packaging | Version: v29-fixes
Severity: low | Resolution:
Keywords: | Ticket locked: 0
----------------------------------+------------------------------
Comment (by baizej):
While gksu can be removed, the issue is the if statements for $SU_TYPE in
the find_su function are flawed.
{{{
if [ -z "$SU" ] ; then
SU=`which gksu`
if [ -z "$SU_TYPE" ]; then
SU_TYPE=gksu
fi
fi
}}}
So if $SU is empty then run 'which gksu' that will return nothing leaving
$SU empty. The rest of the logic for the $SU works fine and will find
sudo with 'which sudo' if none of the others work first.
The issue with the if statement for $SU_TYPE is that $SU_TYPE is set if
empty, so all the following if statements for $SU_TYPE would not apply
since $SU_TYPE has a value.
My change here was to add an if conditional if $SU was set, meaning the
which command succeeded, then the $SU_TYPE is also set.
{{{
if [ -z "$SU" ] ; then
SU=`which gksu`
if [ -z "$SU_TYPE" ] && [ -n "$SU" ]; then
SU_TYPE=gksu
fi
fi
}}}
Once all those are set, now when mythtv-setup is run I hit the "Unknown
option: message" error.
{{{
jon at mythtv-test:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be
insecure.
ERROR 1045 (28000): Access denied for user 'jon'@'localhost' (using
password: NO)
Gtk-Message: 21:34:29.477: GtkDialog mapped without a transient parent.
This is discouraged.
[sudo] password for jon:
Unknown option: message
}}}
This error is coming from line 160 since in my case $DE is not kde and
sudo has no --message argument but instead has --prompt. So we need to
add an elif to test $SU_TYPE if it matches 'sudo' (and isn't $DE=kde since
that was the first if conditional). The existing code:
{{{
if [ "$DE" = "kde" ]; then
$SU_TYPE adduser `whoami` mythtv
else
$SU_TYPE adduser `whoami` mythtv --message "Please enter your
current login password to add `whoami` to the mythtv group."
fi
}}}
Needs to be:
{{{
if [ "$DE" = "kde" ]; then
$SU_TYPE adduser `whoami` mythtv
elif [ "$SU_TYPE" = "sudo" ]; then
$SU_TYPE --prompt="Please enter your current login password to add
`whoami` to the mythtv group." adduser `whoami` mythtv
else
$SU_TYPE adduser `whoami` mythtv --message "Please enter your
current login password to add `whoami` to the mythtv group."
fi
}}}
Though having a case for each sudo type would likely be the best practice.
Now it works:
{{{
jon at mythtv-test:~$ mythtv-setup
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
Couldn't open /etc/mythtv/config.xml:
Permission denied at /usr/share/perl5/XML/SAX/Expat.pm line 75.
XML::Simple called at -e line 5.
mysql: [Warning] Using a password on the command line interface can be
insecure.
ERROR 1045 (28000): Access denied for user 'jon'@'localhost' (using
password: NO)
Gtk-Message: 21:55:37.902: GtkDialog mapped without a transient parent.
This is discouraged.
Please enter your current login password to add jon to the mythtv group.
Adding user `jon' to group `mythtv' ...
Adding user jon to group mythtv
Done.
Gtk-Message: 21:55:42.849: GtkDialog mapped without a transient parent.
This is discouraged.
Gtk-Message: 21:55:47.345: GtkDialog mapped without a transient parent.
This is discouraged.
jon at mythtv-test:~$
}}}
And after logging out and back in mythtv-setup continues on, but there are
other errors in /usr/bin/mythtv-setup that need to be fixed around the
change from upstart to systemd, but I'm guessing that would be another
ticket.
{{{
jon at mythtv-test:~$ mythtv-setup
mysql: [Warning] Using a password on the command line interface can be
insecure.
/usr/bin/mythtv-setup: 42: /usr/bin/mythtv-setup: status: not found
Gtk-Message: 21:57:30.968: GtkDialog mapped without a transient parent.
This is discouraged.
[sudo] password for jon:
Gtk-Message: 21:57:47.305: GtkDialog mapped without a transient parent.
This is discouraged.
jon at mythtv-test:~$
}}}
This is in a Proxmox LXC container running Ubuntu 18.04 if that makes a
difference.
I've not worked with Git much, so not sure how I would go about submitting
this code.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13256#comment:5>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list