Re: [yocto] Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force)
Hi everybody again, is there any update on this? I'm facing the same issue with the 1.5.2 release. I don't want to add that -f in meta/classes/update-rc.d.bbclass if there is a better solution. (And I'm quite sure there must be a better one ;-) ) Maybe overriding the postrm function in my own meta-layer with some kind of bbclassappend? regards, Richard -Original Message- From: yocto-boun...@yoctoproject.org [mailto:yocto-boun...@yoctoproject.org] On Behalf Of Richard Leitner - SKIDATA Sent: Thursday, November 28, 2013 3:02 PM To: Stath, Paul Cc: Yocto Project Discussion ML (yocto@yoctoproject.org) Subject: Re: [yocto] Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Hi Paul, thank you for that hint and description of your workaround! Looks like you've invested a little bit more time into working around this issue than me :-) I've added -f to the update-rc.d.bbclass and now it's working like a charm: diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass index d8cc342..dbb5781 100644 --- a/meta/classes/update-rc.d.bbclass +++ b/meta/classes/update-rc.d.bbclass @@ -33,7 +33,7 @@ updatercd_postrm() { if test $D != ; then OPT=-f -r $D else - OPT= + OPT=-f fi if type update-rc.d /dev/null 2/dev/null; then update-rc.d $OPT ${INITSCRIPT_NAME} remove Nonetheless, I think there have to be a cleaner way to solve this issue than forcing the update-rc.d. Maybe someone else has an idea how to solve this problem? regards, Richard -Original Message- From: Stath, Paul [mailto:pst...@axxcelera.com] Sent: Wednesday, November 27, 2013 5:40 PM To: Richard Leitner - SKIDATA Cc: Yocto Project Discussion ML (yocto@yoctoproject.org) Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Richard -- My workaround was a little less drastic than yours. (grin) Before upgrading to the new package via 'dpkg -i', I would edit the postrm script in /var/lib/dpkg/info/pkg-name,postrm, adding the -f argument to force the symlink removal, as suggested by the error message. Then the upgrade install works correctly. (With only a warning from the postrm script of the previous package.) I believe that the issue is that when installing a package over an earlier release, dpkg performs the following steps: 1) Extract control files of new package 2) Execute prerm script of previous package if applicable. 3) Execute preinst script of new package. 4) Unpack new files and backup old files. 5) Execute postrm script of previous package if applicable. 6) Configure the package When installing a newer version of the package, the postrm in step 5 fails, because the initscript from the new package is extracted in step 4, and update- rc.d w/o the -f argument exits with a non-zero return code. I would argue that the updatercd_postrm() stanza in the update-rc.d.bbclass should include the -f flag. (Anyone on the list want to chime in on this?) In the meantime, I have added my own updatercd_postrm() stanza in the .bbappend file for the package I'm having issues with, which overrides the one provided by update-rc.d.bbclass. updatercd_postrm() { update-rc.d $D -f ${INITSCRIPT_NAME} remove } -- Paul Stath Axxcelera Broadband Wireless From: Richard Leitner - SKIDATA [richard.leit...@skidata.com] Sent: Wednesday, November 27, 2013 11:02 AM To: Stath, Paul Cc: Yocto Project Discussion ML (yocto@yoctoproject.org) Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Hi Paul, good to hear I'm not the only one suffering from this issue... No, I've received no response on the mailing list yet, but maybe someone has a hint for us now? The only workaround I found is to purge the package and afterwards install the new version. I know this is a really dirty workaround, but it's the only solution I found. Have you discovered any other workarounds, Paul? regards Richard -Original Message- From: Stath, Paul [mailto:pst...@axxcelera.com] Sent: Wednesday, November 27, 2013 4:49 PM To: Richard Leitner - SKIDATA Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Richard -- I am also getting the update-rc.d: /etc/init.d/XXX exists during rc.d purge error when I attempt to install a newer version of one of my packages. It doesn't look like you received any response to your post to the yocto mailing list. Did you get any response, or did you discover a workaround? -- Paul Stath Axxcelera Broadband Wireless ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force)
Hi Paul, thank you for that hint and description of your workaround! Looks like you've invested a little bit more time into working around this issue than me :-) I've added -f to the update-rc.d.bbclass and now it's working like a charm: diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass index d8cc342..dbb5781 100644 --- a/meta/classes/update-rc.d.bbclass +++ b/meta/classes/update-rc.d.bbclass @@ -33,7 +33,7 @@ updatercd_postrm() { if test $D != ; then OPT=-f -r $D else - OPT= + OPT=-f fi if type update-rc.d /dev/null 2/dev/null; then update-rc.d $OPT ${INITSCRIPT_NAME} remove Nonetheless, I think there have to be a cleaner way to solve this issue than forcing the update-rc.d. Maybe someone else has an idea how to solve this problem? regards, Richard -Original Message- From: Stath, Paul [mailto:pst...@axxcelera.com] Sent: Wednesday, November 27, 2013 5:40 PM To: Richard Leitner - SKIDATA Cc: Yocto Project Discussion ML (yocto@yoctoproject.org) Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Richard -- My workaround was a little less drastic than yours. (grin) Before upgrading to the new package via 'dpkg -i', I would edit the postrm script in /var/lib/dpkg/info/pkg-name,postrm, adding the -f argument to force the symlink removal, as suggested by the error message. Then the upgrade install works correctly. (With only a warning from the postrm script of the previous package.) I believe that the issue is that when installing a package over an earlier release, dpkg performs the following steps: 1) Extract control files of new package 2) Execute prerm script of previous package if applicable. 3) Execute preinst script of new package. 4) Unpack new files and backup old files. 5) Execute postrm script of previous package if applicable. 6) Configure the package When installing a newer version of the package, the postrm in step 5 fails, because the initscript from the new package is extracted in step 4, and update-rc.d w/o the -f argument exits with a non-zero return code. I would argue that the updatercd_postrm() stanza in the update-rc.d.bbclass should include the -f flag. (Anyone on the list want to chime in on this?) In the meantime, I have added my own updatercd_postrm() stanza in the .bbappend file for the package I'm having issues with, which overrides the one provided by update-rc.d.bbclass. updatercd_postrm() { update-rc.d $D -f ${INITSCRIPT_NAME} remove } -- Paul Stath Axxcelera Broadband Wireless From: Richard Leitner - SKIDATA [richard.leit...@skidata.com] Sent: Wednesday, November 27, 2013 11:02 AM To: Stath, Paul Cc: Yocto Project Discussion ML (yocto@yoctoproject.org) Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Hi Paul, good to hear I'm not the only one suffering from this issue... No, I've received no response on the mailing list yet, but maybe someone has a hint for us now? The only workaround I found is to purge the package and afterwards install the new version. I know this is a really dirty workaround, but it's the only solution I found. Have you discovered any other workarounds, Paul? regards Richard -Original Message- From: Stath, Paul [mailto:pst...@axxcelera.com] Sent: Wednesday, November 27, 2013 4:49 PM To: Richard Leitner - SKIDATA Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Richard -- I am also getting the update-rc.d: /etc/init.d/XXX exists during rc.d purge error when I attempt to install a newer version of one of my packages. It doesn't look like you received any response to your post to the yocto mailing list. Did you get any response, or did you discover a workaround? -- Paul Stath Axxcelera Broadband Wireless ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force)
Hi Paul, good to hear I'm not the only one suffering from this issue... No, I've received no response on the mailing list yet, but maybe someone has a hint for us now? The only workaround I found is to purge the package and afterwards install the new version. I know this is a really dirty workaround, but it's the only solution I found. Have you discovered any other workarounds, Paul? regards Richard -Original Message- From: Stath, Paul [mailto:pst...@axxcelera.com] Sent: Wednesday, November 27, 2013 4:49 PM To: Richard Leitner - SKIDATA Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Richard -- I am also getting the update-rc.d: /etc/init.d/XXX exists during rc.d purge error when I attempt to install a newer version of one of my packages. It doesn't look like you received any response to your post to the yocto mailing list. Did you get any response, or did you discover a workaround? -- Paul Stath Axxcelera Broadband Wireless ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force)
Richard -- My workaround was a little less drastic than yours. (grin) Before upgrading to the new package via 'dpkg -i', I would edit the postrm script in /var/lib/dpkg/info/pkg-name,postrm, adding the -f argument to force the symlink removal, as suggested by the error message. Then the upgrade install works correctly. (With only a warning from the postrm script of the previous package.) I believe that the issue is that when installing a package over an earlier release, dpkg performs the following steps: 1) Extract control files of new package 2) Execute prerm script of previous package if applicable. 3) Execute preinst script of new package. 4) Unpack new files and backup old files. 5) Execute postrm script of previous package if applicable. 6) Configure the package When installing a newer version of the package, the postrm in step 5 fails, because the initscript from the new package is extracted in step 4, and update-rc.d w/o the -f argument exits with a non-zero return code. I would argue that the updatercd_postrm() stanza in the update-rc.d.bbclass should include the -f flag. (Anyone on the list want to chime in on this?) In the meantime, I have added my own updatercd_postrm() stanza in the .bbappend file for the package I'm having issues with, which overrides the one provided by update-rc.d.bbclass. updatercd_postrm() { update-rc.d $D -f ${INITSCRIPT_NAME} remove } -- Paul Stath Axxcelera Broadband Wireless From: Richard Leitner - SKIDATA [richard.leit...@skidata.com] Sent: Wednesday, November 27, 2013 11:02 AM To: Stath, Paul Cc: Yocto Project Discussion ML (yocto@yoctoproject.org) Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Hi Paul, good to hear I'm not the only one suffering from this issue... No, I've received no response on the mailing list yet, but maybe someone has a hint for us now? The only workaround I found is to purge the package and afterwards install the new version. I know this is a really dirty workaround, but it's the only solution I found. Have you discovered any other workarounds, Paul? regards Richard -Original Message- From: Stath, Paul [mailto:pst...@axxcelera.com] Sent: Wednesday, November 27, 2013 4:49 PM To: Richard Leitner - SKIDATA Subject: RE: Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force) Richard -- I am also getting the update-rc.d: /etc/init.d/XXX exists during rc.d purge error when I attempt to install a newer version of one of my packages. It doesn't look like you received any response to your post to the yocto mailing list. Did you get any response, or did you discover a workaround? -- Paul Stath Axxcelera Broadband Wireless ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
[yocto] Errors with update-rc.d: /etc/init.d/XXX exists during rc.d purge (use -f to force)
Hi, I have problems with the update-rc.d class in my recipes. When I want to update a package which inherits update-rc.d (in my case samba) using dpkg -i I get the following error: root@host:~# dpkg -i /media/USBSTICK/samba-ads_3.5.22-r4_armel.deb (Reading database ... 11931 files and directories currently installed.) Preparing to replace samba-ads 3.5.22-r3 (using .../samba-ads_3.5.22-r4_armel.deb) ... Stopping Samba: smbd nmbd winbindd Unpacking replacement samba-ads ... update-rc.d: /etc/init.d/samba exists during rc.d purge (use -f to force) dpkg: warning: subprocess old post-removal script returned error exit status 1 dpkg: trying script from the new package instead ... update-rc.d: /etc/init.d/samba exists during rc.d purge (use -f to force) dpkg: error processing /media/USBSTICK/samba-ads_3.5.22-r4_armel.deb (--install): subprocess new post-removal script returned error exit status 1 update-rc.d: /etc/init.d/samba exists during rc.d purge (use -f to force) dpkg: error while cleaning up: subprocess new post-removal script returned error exit status 1 Errors were encountered while processing: /media/USBSTICK/samba-ads_3.5.22-r4_armel.deb When I afterwards want to remove/purge the package it fails with the following message: root@host:~# dpkg -P samba-ads dpkg: error processing samba-ads (--purge): Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Errors were encountered while processing: samba-ads The only way how to fix that problem is to manually remove the initscript and then install the update: root@000C320C08C0:~# rm /etc/init.d/samba root@000C320C08C0:~# dpkg -i /media/USBSTICK/samba-ads_3.5.22-r4_armel.deb (Reading database ... 11931 files and directories currently installed.) Preparing to replace samba-ads 3.5.22-r3 (using .../samba-ads_3.5.22-r4_armel.deb) ... Unpacking replacement samba-ads ... Removing any system startup links for samba ... /etc/rc0.d/K20samba /etc/rc1.d/K20samba /etc/rc2.d/S20samba /etc/rc3.d/S20samba /etc/rc4.d/S20samba /etc/rc5.d/S20samba /etc/rc6.d/K20samba Setting up samba-ads (3.5.22-r4) ... Adding system startup for /etc/init.d/samba. Starting Samba: smbd nmbd winbindd. The update-rc.d part of my recipe is shown below. inherit autotools update-rc.d ... INITSCRIPT_NAME = samba INITSCRIPT_PARAMS = defaults ... do_install_append() { ... install -D -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/samba ... } Does anybody have an idea how to fix that issue? Would be really great! Thank you! Regards, Richard ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto