Bug#369666: cron-apt: needs to depend on mailx
severity #369666 wishlist retitle #369666 Fail more gracefully when mailx is not available. tags #369666 patch thanks On Fri, Jun 02, 2006 at 07:10:23AM +0200, Ola Lundqvist wrote: reopen 369666 severity wishlist retitle Fail more gracefully when mailx is not available. Fixing syntax errors. Well that can be argued as it is the meaning with recommends, but I can reopen it as a wishlist bug. Attached patch will issue a warning if mail binary is not found. Greetings Marc -- - Marc Haber | I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things.Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 --- cron-apt.orig 2007-07-28 09:08:16.0 +0200 +++ cron-apt2007-07-28 09:12:10.0 +0200 @@ -273,15 +273,19 @@ rm -f $RUNMAIL fi if [ -f $MAIL ] ; then -if [ -z $HOSTNAME ]; then -HOSTNAME=$(uname -n) - fi - SUBJECT=CRON-APT completed on $HOSTNAME [$CONFIG] - if [ -f $ERROR ] ; then - SUBJECT=CRON-APT error on $HOSTNAME [$CONFIG] + if command -v mail /dev/null; then +if [ -z $HOSTNAME ]; then +HOSTNAME=$(uname -n) + fi + SUBJECT=CRON-APT completed on $HOSTNAME [$CONFIG] + if [ -f $ERROR ] ; then + SUBJECT=CRON-APT error on $HOSTNAME [$CONFIG] + fi + mail -s $SUBJECT $MAILTO $MAIL + rm -f $MAIL + else + echo 2 cron-apt was configured to send e-mail, but no mail binary found in path. fi - mail -s $SUBJECT $MAILTO $MAIL - rm -f $MAIL fi if [ -f $DIFF ] ; then rm -f $DIFF
Bug#369666: cron-apt: needs to depend on mailx
Hi Marc Thanks for the patch. However I have some questions about it. See below. On Sat, Jul 28, 2007 at 09:14:00AM +0200, Marc Haber wrote: severity #369666 wishlist retitle #369666 Fail more gracefully when mailx is not available. tags #369666 patch thanks On Fri, Jun 02, 2006 at 07:10:23AM +0200, Ola Lundqvist wrote: reopen 369666 severity wishlist retitle Fail more gracefully when mailx is not available. Fixing syntax errors. Well that can be argued as it is the meaning with recommends, but I can reopen it as a wishlist bug. Attached patch will issue a warning if mail binary is not found. Greetings Marc -- - Marc Haber | I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things.Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 --- cron-apt.orig 2007-07-28 09:08:16.0 +0200 +++ cron-apt 2007-07-28 09:12:10.0 +0200 @@ -273,15 +273,19 @@ rm -f $RUNMAIL fi if [ -f $MAIL ] ; then -if [ -z $HOSTNAME ]; then -HOSTNAME=$(uname -n) - fi - SUBJECT=CRON-APT completed on $HOSTNAME [$CONFIG] - if [ -f $ERROR ] ; then - SUBJECT=CRON-APT error on $HOSTNAME [$CONFIG] + if command -v mail /dev/null; then Why do you use command instead of just checking with -x? Like if [ -x $(which fmail) ] ; then +if [ -z $HOSTNAME ]; then +HOSTNAME=$(uname -n) + fi + SUBJECT=CRON-APT completed on $HOSTNAME [$CONFIG] + if [ -f $ERROR ] ; then + SUBJECT=CRON-APT error on $HOSTNAME [$CONFIG] + fi + mail -s $SUBJECT $MAILTO $MAIL + rm -f $MAIL + else + echo 2 cron-apt was configured to send e-mail, but no mail binary found in path. fi - mail -s $SUBJECT $MAILTO $MAIL - rm -f $MAIL fi Shouldn't this $MAIL file be removed even if the mail command can not be found? if [ -f $DIFF ] ; then rm -f $DIFF Best regards, // Ola -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering / [EMAIL PROTECTED] Annebergsslingan 37\ | [EMAIL PROTECTED] 654 65 KARLSTAD| | http://opalsys.net/ Mobile: +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#369666: cron-apt: needs to depend on mailx
On Sat, Jul 28, 2007 at 12:15:30PM +0200, Ola Lundqvist wrote: + if command -v mail /dev/null; then Why do you use command instead of just checking with -x? Like if [ -x $(which fmail) ] ; then Habit out of maintainer scripts that does not need any special shell features. It is common practice in maintainer scripts. In the package itself, I do not care too much, and -x which is as good as the command constructs, I guess. - mail -s $SUBJECT $MAILTO $MAIL - rm -f $MAIL fi Shouldn't this $MAIL file be removed even if the mail command can not be found? Yes, it should. Greetings Marc -- - Marc Haber | I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things.Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 3221 2323190 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#369666: cron-apt: needs to depend on mailx
reopen 369666 severity wishlist retitle Fail more gracefully when mailx is not available. thanks Hi On Thu, Jun 01, 2006 at 06:14:28PM +0200, Marc Haber wrote: On Wed, May 31, 2006 at 05:54:54PM +0200, Ola Lundqvist wrote: mailx is recommended, and that is the proper dependency as it by default need mailx, but can be configured not to need it. Ok. I see. In that case, cron-apt should handle missing mailx more gracefully than dumping a shell error message about the non-existent mail command into a cron-mail as this looks like an actual bug instead of designed behavior. Well that can be argued as it is the meaning with recommends, but I can reopen it as a wishlist bug. Thanks // Ola Greetings Marc -- - Marc Haber | I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things.Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering / [EMAIL PROTECTED] Annebergsslingan 37\ | [EMAIL PROTECTED] 654 65 KARLSTAD| | http://www.opal.dhs.org Mobile: +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#369666: cron-apt: needs to depend on mailx
Package: cron-apt Version: 0.4.6 Severity: normal Hi, one of my systems recently removed mailx because no packages depended on it any more. cron-apt uses mail, and thus should depend on mailx. Greetings Marc -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.17-rc5-zgsrv Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Versions of packages cron-apt depends on: ii apt 0.6.44.1 Advanced front-end for dpkg ii debianutils 2.16.1 Miscellaneous utilities specific t Versions of packages cron-apt recommends: ii liblockfile1 1.06.1 NFS-safe locking library, includes ii mailx1:8.1.2-0.20050715cvs-1 A simple mail user agent -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#369666: cron-apt: needs to depend on mailx
Marc Haber wrote: one of my systems recently removed mailx because no packages depended on it any more. cron-apt uses mail, and thus should depend on mailx. It looks like mailx has been downgraded from important to standard in Sid. I see this on the mailx development page. There were override disparities found in suite unstable: * mailx: Override says mail - standard, .deb says mail - important In Sarge mailx is priority important and would not have required a dependency, I think? I wonder how many other packages will have this similar transition issue? Bob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]