Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-11 Thread Sebastian Humenda
Hi

Mattia Dongili schrieb am 11.03.2017,  8:08 -0800:
>On Wed, Mar 08, 2017 at 09:55:02PM +0100, Andreas Henriksson wrote:
>as the error suggests, the unterminated string is in
>/etc/default/cpufrequtils rather than in the init script.
>
>/etc/init.d/cpufrequtils sources the defaults file, so that too has to be
Actually, I overlooked that bit. I didn't touch that file either, but it's also
not removed by "apt purge", so it stayed there. After removing it, installing
works again.


Thanks for closing the report
Sebastian


signature.asc
Description: PGP signature


Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-11 Thread Mattia Dongili
On Sat, Mar 11, 2017 at 05:06:39PM +0100, Sebastian Humenda wrote:
> Hi

Hi,
it looks like we almost overlapped in our replies.

> Andreas Henriksson schrieb am 08.03.2017, 21:55 +0100:
> >On Wed, Mar 08, 2017 at 10:57:38AM +0100, Sebastian Humenda wrote:
...
> >> Mar 08 10:54:47 kraftkrust cpufrequtils[13461]: /etc/init.d/cpufrequtils: 
> >> 3: /etc/default/cpufrequtils: Syntax error: Unterminated quoted string
...
> >Could you please attach your /etc/init.d/cpufrequtils ? Do you know
> >if this file was ever modified by you or not?
> It is attached. It has not been modified by me, especially I have just purged 
> it
> and the issue persists.

Just to reiterate, it's /etc/default/cpufrequtils that has an
unterminated quoted string, not /etc/init.d/cpufrequtils.

Could you check that?

Thanks
-- 
mattia
:wq!


signature.asc
Description: PGP signature


Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-11 Thread Mattia Dongili
On Wed, Mar 08, 2017 at 09:55:02PM +0100, Andreas Henriksson wrote:
> Control: tags -1 + moreinfo
> 
> Hello Sebastian Humenda,
> 
> Thanks for your bug report
> 
> On Wed, Mar 08, 2017 at 10:57:38AM +0100, Sebastian Humenda wrote:
> > Package: cpufrequtils
> > Version: 008-1+b1
> > Severity: grave
> > Justification: renders package unusable
> [...]
> > Mar 08 10:54:47 kraftkrust cpufrequtils[13461]: /etc/init.d/cpufrequtils: 
> > 3: /etc/default/cpufrequtils: Syntax error: Unterminated quoted string
> [...]
> 
> The /etc/init.d/cpufrequtils file is not shipped in the package since
> cpufrequtils 002-2.1 (a very long time ago, prior to old-old-stable).

as the error suggests, the unterminated string is in
/etc/default/cpufrequtils rather than in the init script.

/etc/init.d/cpufrequtils sources the defaults file, so that too has to be
correctly parseable by /bin/sh.

if [ -f /etc/default/cpufrequtils ] ; then
. /etc/default/cpufrequtils
fi

/etc/default/cpufrequtils is not a file managed by the package.

Sebastian,
Let me know if you need help writing the defaults file.

I'm closing this bug report.
-- 
mattia
:wq!



Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-11 Thread Sebastian Humenda
Hi

Andreas Henriksson schrieb am 08.03.2017, 21:55 +0100:
>On Wed, Mar 08, 2017 at 10:57:38AM +0100, Sebastian Humenda wrote:
>> Package: cpufrequtils
>> Version: 008-1+b1
>> Severity: grave
>> Justification: renders package unusable
>[...]
>> Mar 08 10:54:47 kraftkrust cpufrequtils[13461]: /etc/init.d/cpufrequtils: 3: 
>> /etc/default/cpufrequtils: Syntax error: Unterminated quoted string
>[...]
>
>The /etc/init.d/cpufrequtils file is not shipped in the package since
>cpufrequtils 002-2.1 (a very long time ago, prior to old-old-stable).
This machine was set up with Jessie, so it's certainly not a left-over.

>I would guess the init script breaking down is simply caused by your
>local configuration. Possibly the package did not properly remove
>the config file back when it was removed ages ago.
Mh, ok. I have tried
`sudo apt-get purge cpufrequtils && sudo apt install cpufrequtils`.

After a purge, no init script is present.

>Anyway, the installs and works fine here in the normal case.
I am interested what the unusual case for my system is.

>Could you please attach your /etc/init.d/cpufrequtils ? Do you know
>if this file was ever modified by you or not?
It is attached. It has not been modified by me, especially I have just purged it
and the issue persists.

Sorry for the late reply, I had overlooked the email and will respond in a more
timely fashion to make this not a blocker for Stretch.

Thanks!
Sebastian

#!/bin/sh
### BEGIN INIT INFO
# Provides:   cpufrequtils
# Required-Start: $remote_fs loadcpufreq
# Required-Stop:
# Default-Start:  2 3 4 5
# Default-Stop:
# Short-Description: set CPUFreq kernel parameters
# Description: utilities to deal with CPUFreq Linux 
#   kernel support
### END INIT INFO
# 

DESC="CPUFreq Utilities"

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
CPUFREQ_SET=/usr/bin/cpufreq-set
CPUFREQ_INFO=/usr/bin/cpufreq-info
CPUFREQ_OPTIONS=""

# use lsb-base
. /lib/lsb/init-functions

# Which governor to use. Must be one of the governors listed in:
#   cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
#
# and which limits to set. Both MIN_SPEED and MAX_SPEED must be values
# listed in:
#   cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
# a value of 0 for any of the two variables will disabling the use of 
# that limit variable.
#
# WARNING: the correct kernel module must already be loaded or compiled in.
# 
# Set ENABLE to "true" to let the script run at boot time.
# 
# eg:   ENABLE="true"
#   GOVERNOR="ondemand"
#   MAX_SPEED=1000
#   MIN_SPEED=500

ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="0"
MIN_SPEED="0"

check_governor_avail() {
info="/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"
if [ -f $info ] && grep -q "\<$GOVERNOR\>" $info ; then
return 0;
fi
return 1;
}

[ -x $CPUFREQ_SET ] || exit 0

if [ -f /etc/default/cpufrequtils ] ; then
. /etc/default/cpufrequtils
fi

# if not enabled then exit gracefully
[ "$ENABLE" = "true" ] || exit 0

if [ -n "$MAX_SPEED" ] && [ $MAX_SPEED != "0" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --max $MAX_SPEED"
fi

if [ -n "$MIN_SPEED" ] && [ $MIN_SPEED != "0" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --min $MIN_SPEED"
fi

if [ -n "$GOVERNOR" ] ; then
CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --governor $GOVERNOR"
fi

CPUS=$(cat /proc/stat|sed -ne 's/^cpu\([[:digit:]]\+\).*/\1/p')
RETVAL=0
case "$1" in
start|force-reload|restart|reload)
log_action_begin_msg "$DESC: Setting $GOVERNOR CPUFreq governor"
if check_governor_avail ; then
for cpu in $CPUS ; do
log_action_cont_msg "CPU${cpu}"
$CPUFREQ_SET --cpu $cpu $CPUFREQ_OPTIONS 2>&1 > 
/dev/null || \
RETVAL=$?
done
log_action_end_msg $RETVAL ""
else
log_action_cont_msg "disabled, governor not available"
log_action_end_msg $RETVAL
fi
;;
stop)
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac

exit 0



signature.asc
Description: PGP signature


Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-11 Thread John Paul Adrian Glaubitz
Hi Andreas!

> The /etc/init.d/cpufrequtils file is not shipped in the package since
> cpufrequtils 002-2.1 (a very long time ago, prior to old-old-stable).

I just reinstalled the package after purging it to be sure and indeed,
the init script is still present:

root@ikarus:~# dpkg -L cpufrequtils |grep init.d
/etc/init.d
/etc/init.d/cpufrequtils
/etc/init.d/loadcpufreq
root@ikarus:~#

Is it possible it managed to slip back into the package by accident?

> Anyway, the installs and works fine here in the normal case.

Same here. Installs without any issues.

Please don't wait for too long for feedback before closing this again
so we're not creating additional blockers for the Stretch release.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-08 Thread Andreas Henriksson
Control: tags -1 + moreinfo

Hello Sebastian Humenda,

Thanks for your bug report

On Wed, Mar 08, 2017 at 10:57:38AM +0100, Sebastian Humenda wrote:
> Package: cpufrequtils
> Version: 008-1+b1
> Severity: grave
> Justification: renders package unusable
[...]
> Mar 08 10:54:47 kraftkrust cpufrequtils[13461]: /etc/init.d/cpufrequtils: 3: 
> /etc/default/cpufrequtils: Syntax error: Unterminated quoted string
[...]

The /etc/init.d/cpufrequtils file is not shipped in the package since
cpufrequtils 002-2.1 (a very long time ago, prior to old-old-stable).

I would guess the init script breaking down is simply caused by your
local configuration. Possibly the package did not properly remove
the config file back when it was removed ages ago.

Anyway, the installs and works fine here in the normal case.

Could you please attach your /etc/init.d/cpufrequtils ? Do you know
if this file was ever modified by you or not?

Regards,
Andreas Henriksson



Bug#857126: cpufrequtils: Fails to install/upgrade (syntax error in init script)

2017-03-08 Thread Sebastian Humenda
Package: cpufrequtils
Version: 008-1+b1
Severity: grave
Justification: renders package unusable

Hi

After executing `apt-get dist-upgrade`, I get:

Setting up cpufrequtils (008-1+b1) ...
update-rc.d: warning: start and stop actions are no longer supported; falling 
back to defaults
update-rc.d: warning: start and stop actions are no longer supported; falling 
back to defaults
Job for cpufrequtils.service failed because the control process exited with 
error code.
See "systemctl status cpufrequtils.service" and "journalctl -xe" for details.
invoke-rc.d: initscript cpufrequtils, action "start" failed.
* cpufrequtils.service - LSB: set CPUFreq kernel parameters
   Loaded: loaded (/etc/init.d/cpufrequtils; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-03-08 10:54:47 CET; 4ms ago
 Docs: man:systemd-sysv-generator(8)
  Process: 13461 ExecStart=/etc/init.d/cpufrequtils start (code=exited, 
status=2)

Mar 08 10:54:47 kraftkrust systemd[1]: Starting LSB: set CPUFreq kernel 
parameters...
Mar 08 10:54:47 kraftkrust cpufrequtils[13461]: /etc/init.d/cpufrequtils: 3: 
/etc/default/cpufrequtils: Syntax error: Unterminated quoted string
Mar 08 10:54:47 kraftkrust systemd[1]: cpufrequtils.service: Control process 
exited, code=exited status=2
Mar 08 10:54:47 kraftkrust systemd[1]: Failed to start LSB: set CPUFreq kernel 
parameters.
Mar 08 10:54:47 kraftkrust systemd[1]: cpufrequtils.service: Unit entered 
failed state.
Mar 08 10:54:47 kraftkrust systemd[1]: cpufrequtils.service: Failed with result 
'exit-code'.
dpkg: error processing package cpufrequtils (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 cpufrequtils
E: Sub-process /usr/bin/dpkg returned an error code (1)

Please let me know if I can provide more details.

Thanks
Sebastian

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-debug'), (450, 'unstable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cpufrequtils depends on:
ii  debconf [debconf-2.0]  1.5.60
ii  libc6  2.24-9
ii  libcpufreq0008-1+b1
ii  lsb-base   9.20161125

cpufrequtils recommends no packages.

cpufrequtils suggests no packages.

-- debconf information:
  cpufrequtils/enable: true