* [gentoo-user] local.start and sending an email
@ 2005-11-03 21:04 John J. Foster
2005-11-03 21:19 ` Billy Holmes
0 siblings, 1 reply; 17+ messages in thread
From: John J. Foster @ 2005-11-03 21:04 UTC (permalink / raw
To: Gentoo User
[-- Attachment #1: Type: text/plain, Size: 891 bytes --]
Good afternoon,
I have the following 2 entries in /etc/conf.d/local.start
# Record system restart
echo "System restart on `date +%F` at `date +%R`" >> /var/log/reboot.log
# Send email notification that the system just restarted
date|mutt -s 'System restarted' myemail@myprovider
The first one properly records the fact that the system has been
restarted, but I do not receive an email. Watching the console as the
system comes up, I see a Segmentation Fault when the second command
executes. Running that command from a shell prompt works fine. I am
under the impression, possibly incorrectly, that local.start is run
after all other init scripts.
depend() {
after *
}
Do I perhaps need to pause a bit in order to let something else finish?
I am using ssmtp for mail.
Thanks,
John
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-03 21:04 [gentoo-user] local.start and sending an email John J. Foster
@ 2005-11-03 21:19 ` Billy Holmes
2005-11-03 23:07 ` Peper
2005-11-04 1:48 ` John J. Foster
0 siblings, 2 replies; 17+ messages in thread
From: Billy Holmes @ 2005-11-03 21:19 UTC (permalink / raw
To: gentoo-user
John J. Foster wrote:
> date|mutt -s 'System restarted' myemail@myprovider
try putting in the full path to the commands?
the environment that local.start is in is not the same as your shell.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-03 21:19 ` Billy Holmes
@ 2005-11-03 23:07 ` Peper
2005-11-04 1:48 ` John J. Foster
1 sibling, 0 replies; 17+ messages in thread
From: Peper @ 2005-11-03 23:07 UTC (permalink / raw
To: gentoo-user
> try putting in the full path to the commands?
>
> the environment that local.start is in is not the same as your shell.
Don't think so. It won't be a segfault then...
My only idea is to add "echo local.start" to the script and check when it is
executed.
--
Best Regards,
Peper
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-03 21:19 ` Billy Holmes
2005-11-03 23:07 ` Peper
@ 2005-11-04 1:48 ` John J. Foster
2005-11-04 8:14 ` Neil Bothwick
1 sibling, 1 reply; 17+ messages in thread
From: John J. Foster @ 2005-11-04 1:48 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
On Thu, Nov 03, 2005 at 04:19:39PM -0500, Billy Holmes wrote:
> John J. Foster wrote:
> >date|mutt -s 'System restarted' myemail@myprovider
>
> try putting in the full path to the commands?
>
I tried changing this to
/usr/bin/date | /usr/bin/mutt -s 'System restarted' myemail@myprovider
and get the same segmentation fault.
Don't know if it matters, or not, but I'm running kernel 2.6.13-gentoo-r5,
fully patched
Thanks,
John
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 1:48 ` John J. Foster
@ 2005-11-04 8:14 ` Neil Bothwick
2005-11-04 13:16 ` John J. Foster
0 siblings, 1 reply; 17+ messages in thread
From: Neil Bothwick @ 2005-11-04 8:14 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
On Thu, 3 Nov 2005 20:48:43 -0500, John J. Foster wrote:
> I tried changing this to
>
> /usr/bin/date | /usr/bin/mutt -s 'System restarted' myemail@myprovider
>
> and get the same segmentation fault.
Isn't mutt overkill for this? Do you really need a full MUA on a server.
I use mail for this sort of thing, emerge mailx.
Having said that, it would be useful to find out why mutt is segfaulting.
You can eliminate and environment differences by sourcing /etc/profile
before running it. I find this often helps with cron scripts.
--
Neil Bothwick
Minds are like parachutes; they only function when fully open. * Sir
James Dewar
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 8:14 ` Neil Bothwick
@ 2005-11-04 13:16 ` John J. Foster
2005-11-04 13:41 ` Peper
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: John J. Foster @ 2005-11-04 13:16 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1823 bytes --]
On Fri, Nov 04, 2005 at 08:14:59AM +0000, Neil Bothwick wrote:
> On Thu, 3 Nov 2005 20:48:43 -0500, John J. Foster wrote:
>
> > I tried changing this to
> >
> > /usr/bin/date | /usr/bin/mutt -s 'System restarted' myemail@myprovider
> >
> > and get the same segmentation fault.
>
> Isn't mutt overkill for this? Do you really need a full MUA on a server.
> I use mail for this sort of thing, emerge mailx.
>
I agree that this would most certainly be overkill for a server. But
this is my home machine, and I'd just like to receive notification at
work if it reboots for some odd reason.
> Having said that, it would be useful to find out why mutt is segfaulting.
> You can eliminate and environment differences by sourcing /etc/profile
> before running it. I find this often helps with cron scripts.
>
I did note something I consider quite odd, though. While rebooting,
local.start runs right _before_ inittab starts to bring the system to
runlevel 3.
A couple thing here.
rc-status shows /etc/init.d/local as part of the _default_ runlevel.
/etc/init.d/local stop - warns about shutting a boot service. This
warning only happens the first time it is stopped after a reboot.
Subsequent stops and starts produce no warnings.
It looks to me like _local_ is for some reason being started earlier
than it should, or my understanding of the boot process is limited.
Thanks,
John
>
> --
> Neil Bothwick
>
> Minds are like parachutes; they only function when fully open. * Sir
> James Dewar
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
>
> iD8DBQFDaxiDum4al0N1GQMRAqPDAJ9LOt/L/8QsADVTK/odaA3FRtzYlQCbBiuV
> R70e5FCXgWWoH/5dkVOlQzc=
> =pPl0
> -----END PGP SIGNATURE-----
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 13:16 ` John J. Foster
@ 2005-11-04 13:41 ` Peper
2005-11-04 14:30 ` Peper
2005-11-04 13:47 ` Neil Bothwick
2005-11-04 15:14 ` John J. Foster
2 siblings, 1 reply; 17+ messages in thread
From: Peper @ 2005-11-04 13:41 UTC (permalink / raw
To: gentoo-user
> I did note something I consider quite odd, though. While rebooting,
> local.start runs right _before_ inittab starts to bring the system to
> runlevel 3.
>
> A couple thing here.
>
> rc-status shows /etc/init.d/local as part of the _default_ runlevel.
>
> /etc/init.d/local stop - warns about shutting a boot service. This
> warning only happens the first time it is stopped after a reboot.
> Subsequent stops and starts produce no warnings.
>
> It looks to me like _local_ is for some reason being started earlier
> than it should, or my understanding of the boot process is limited.
Strange for me. Maybe your local is added to both runlevels? Check rc-status
boot. If it's not i would try rc-update add local boot and then rc-update del
boot.
--
Best Regards,
Peper
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 13:16 ` John J. Foster
2005-11-04 13:41 ` Peper
@ 2005-11-04 13:47 ` Neil Bothwick
2005-11-04 14:05 ` John J. Foster
2005-11-04 15:14 ` John J. Foster
2 siblings, 1 reply; 17+ messages in thread
From: Neil Bothwick @ 2005-11-04 13:47 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 441 bytes --]
On Fri, 4 Nov 2005 08:16:07 -0500, John J. Foster wrote:
> I did note something I consider quite odd, though. While rebooting,
> local.start runs right _before_ inittab starts to bring the system to
> runlevel 3.
That's odd, it definitely runs last here, as it appears is should.
Have you trued using mail instead of mutt? It should give a clue as to
where the problem lies.
--
Neil Bothwick
Life is like an analogy.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 13:47 ` Neil Bothwick
@ 2005-11-04 14:05 ` John J. Foster
2005-11-04 15:33 ` Neil Bothwick
0 siblings, 1 reply; 17+ messages in thread
From: John J. Foster @ 2005-11-04 14:05 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]
On Fri, Nov 04, 2005 at 01:47:55PM +0000, Neil Bothwick wrote:
> On Fri, 4 Nov 2005 08:16:07 -0500, John J. Foster wrote:
>
> > I did note something I consider quite odd, though. While rebooting,
> > local.start runs right _before_ inittab starts to bring the system to
> > runlevel 3.
>
> That's odd, it definitely runs last here, as it appears is should.
Agreed.
>
> Have you trued using mail instead of mutt? It should give a clue as to
> where the problem lies.
May I ask why trying mail, which I will this weekend, would at all
explain why local is starting in the wrong runlevel?
Thanks,
John
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 13:41 ` Peper
@ 2005-11-04 14:30 ` Peper
0 siblings, 0 replies; 17+ messages in thread
From: Peper @ 2005-11-04 14:30 UTC (permalink / raw
To: gentoo-user
> rc-update del boot.
Of course i meant rc-update del local boot.
--
Best Regards,
Peper
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 13:16 ` John J. Foster
2005-11-04 13:41 ` Peper
2005-11-04 13:47 ` Neil Bothwick
@ 2005-11-04 15:14 ` John J. Foster
2005-11-05 0:16 ` John J. Foster
2 siblings, 1 reply; 17+ messages in thread
From: John J. Foster @ 2005-11-04 15:14 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]
On Fri, Nov 04, 2005 at 08:16:07AM -0500, John J. Foster wrote:
> >
> I did note something I consider quite odd, though. While rebooting,
> local.start runs right _before_ inittab starts to bring the system to
> runlevel 3.
>
> A couple thing here.
>
> rc-status shows /etc/init.d/local as part of the _default_ runlevel.
>
> /etc/init.d/local stop - warns about shutting a boot service. This
> warning only happens the first time it is stopped after a reboot.
> Subsequent stops and starts produce no warnings.
>
> It looks to me like _local_ is for some reason being started earlier
> than it should, or my understanding of the boot process is limited.
>
OK, I may have found the answer here, which I'll verify tonight when I
get home and can watch a reboot.
/etc/init.d/local needsme
showed that /etc/init.d/splash was dependent on local. splash was in the
boot runlevel, although I haven't used splash for a few months now, and
obviously forgot to remove it. I am pretty sure this will solve my
problem.
I'll let you know.
John
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 14:05 ` John J. Foster
@ 2005-11-04 15:33 ` Neil Bothwick
0 siblings, 0 replies; 17+ messages in thread
From: Neil Bothwick @ 2005-11-04 15:33 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
On Fri, 4 Nov 2005 09:05:09 -0500, John J. Foster wrote:
> > Have you trued using mail instead of mutt? It should give a clue as to
> > where the problem lies.
>
> May I ask why trying mail, which I will this weekend, would at all
> explain why local is starting in the wrong runlevel?
It wouldn't, but it may help to determine whether the problem is specific
to mutt or wider ranging.
--
Neil Bothwick
If nothing sticks to Teflon, how do they stick teflon on the pan?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-04 15:14 ` John J. Foster
@ 2005-11-05 0:16 ` John J. Foster
2005-11-05 22:52 ` Neil Bothwick
0 siblings, 1 reply; 17+ messages in thread
From: John J. Foster @ 2005-11-05 0:16 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]
On Fri, Nov 04, 2005 at 10:14:28AM -0500, John J. Foster wrote:
> On Fri, Nov 04, 2005 at 08:16:07AM -0500, John J. Foster wrote:
> > >
> > I did note something I consider quite odd, though. While rebooting,
> > local.start runs right _before_ inittab starts to bring the system to
> > runlevel 3.
> >
> > A couple thing here.
> >
> > rc-status shows /etc/init.d/local as part of the _default_ runlevel.
> >
> > /etc/init.d/local stop - warns about shutting a boot service. This
> > warning only happens the first time it is stopped after a reboot.
> > Subsequent stops and starts produce no warnings.
> >
> > It looks to me like _local_ is for some reason being started earlier
> > than it should, or my understanding of the boot process is limited.
> >
> OK, I may have found the answer here, which I'll verify tonight when I
> get home and can watch a reboot.
>
> /etc/init.d/local needsme
>
> showed that /etc/init.d/splash was dependent on local. splash was in the
> boot runlevel, although I haven't used splash for a few months now, and
> obviously forgot to remove it. I am pretty sure this will solve my
> problem.
>
Well damn. Removing /etc/init.d/splash from the boot runlevel did in fact
cause /etc/init.d/local to run as the last initscript, just like it's
supposed to. But it didn't solve the problem of mutt segfaulting when
called here.
I took Neil's advice and emerged mailx. All is well again in gentooland.
(I'd sure like to know why mutt didn't work in local.start, though)
Thanks for all the help,
John
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-05 0:16 ` John J. Foster
@ 2005-11-05 22:52 ` Neil Bothwick
2005-11-06 0:26 ` John J. Foster
0 siblings, 1 reply; 17+ messages in thread
From: Neil Bothwick @ 2005-11-05 22:52 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 710 bytes --]
On Fri, 4 Nov 2005 19:16:16 -0500, John J. Foster wrote:
> Well damn. Removing /etc/init.d/splash from the boot runlevel did in
> fact cause /etc/init.d/local to run as the last initscript, just like
> it's supposed to. But it didn't solve the problem of mutt segfaulting
> when called here.
>
> I took Neil's advice and emerged mailx. All is well again in gentooland.
>
> (I'd sure like to know why mutt didn't work in local.start, though)
If the same command works in a terminal, it could be a difference in the
environment. The first thing I would try is running "source /etc/profile"
right before the mutt call.
--
Neil Bothwick
What was the greatest thing BEFORE sliced bread?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] local.start and sending an email
2005-11-05 22:52 ` Neil Bothwick
@ 2005-11-06 0:26 ` John J. Foster
2005-11-06 7:16 ` [gentoo-user] " Francesco Talamona
0 siblings, 1 reply; 17+ messages in thread
From: John J. Foster @ 2005-11-06 0:26 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 678 bytes --]
On Sat, Nov 05, 2005 at 10:52:20PM +0000, Neil Bothwick wrote:
>
> If the same command works in a terminal, it could be a difference in the
> environment. The first thing I would try is running "source /etc/profile"
> right before the mutt call.
No go. Just for review, here's a few lines from local.start.
source /etc/profile
/usr/bin/date | /usr/bin/mutt -s "System restarted" addy@isp
Now, the error message
Error sending message, child exited 1 ().
/etc/conf.d/local.start: line 15: 19174 Done
/usr/bin/date
19175 Segmentation fault | /usr/bin/mutt -s "System restarted" addy@isp
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* [gentoo-user] Re: local.start and sending an email
2005-11-06 0:26 ` John J. Foster
@ 2005-11-06 7:16 ` Francesco Talamona
2005-11-06 13:03 ` John J. Foster
0 siblings, 1 reply; 17+ messages in thread
From: Francesco Talamona @ 2005-11-06 7:16 UTC (permalink / raw
To: gentoo-user
On Sunday 06 November 2005 01:26, John J. Foster wrote:
> On Sat, Nov 05, 2005 at 10:52:20PM +0000, Neil Bothwick wrote:
> > If the same command works in a terminal, it could be a difference
> > in the environment. The first thing I would try is running "source
> > /etc/profile" right before the mutt call.
>
> No go. Just for review, here's a few lines from local.start.
>
> source /etc/profile
> /usr/bin/date | /usr/bin/mutt -s "System restarted" addy@isp
>
> Now, the error message
>
> Error sending message, child exited 1 ().
> /etc/conf.d/local.start: line 15: 19174 Done
> /usr/bin/date
> 19175 Segmentation fault | /usr/bin/mutt -s "System
> restarted" addy@isp
I reread the whole thread, till now we focused on mail program, but
segfault came just after "date" command, maybe we just looked in the
wrong direction...
Do you have all partitions mounted at the time local runs,
are /usr /var /lib ... all mounted and accessible by then? Can it be a
permission problem? So who is the user running the script?...
Ciao
Francesco
--
Linux Version 2.6.12-gentoo-r9, Compiled #2 Wed Aug 24 18:43:16 CEST
2005
One 2.2GHz AMD Athlon 64 Processor, 2GB RAM, 4325.37 Bogomips Total
aemaeth
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Re: local.start and sending an email
2005-11-06 7:16 ` [gentoo-user] " Francesco Talamona
@ 2005-11-06 13:03 ` John J. Foster
0 siblings, 0 replies; 17+ messages in thread
From: John J. Foster @ 2005-11-06 13:03 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
On Sun, Nov 06, 2005 at 08:16:44AM +0100, Francesco Talamona wrote:
> > source /etc/profile
> > /usr/bin/date | /usr/bin/mutt -s "System restarted" addy@isp
> >
> > Now, the error message
> >
> > Error sending message, child exited 1 ().
> > /etc/conf.d/local.start: line 15: 19174 Done
> > /usr/bin/date
> > 19175 Segmentation fault | /usr/bin/mutt -s "System
> > restarted" addy@isp
>
> I reread the whole thread, till now we focused on mail program, but
> segfault came just after "date" command, maybe we just looked in the
> wrong direction...
Yeah, I thought that at first. Except for the "error sending message"
line and that changing to mailx works properly.
>
> Do you have all partitions mounted at the time local runs,
> are /usr /var /lib ... all mounted and accessible by then?
Yep - only have a /, /boot and a swap
> permission problem? So who is the user running the script?...
root during boot
Thanks,
John
--
If voting could change anything,
it would be illegal
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2005-11-06 13:11 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-03 21:04 [gentoo-user] local.start and sending an email John J. Foster
2005-11-03 21:19 ` Billy Holmes
2005-11-03 23:07 ` Peper
2005-11-04 1:48 ` John J. Foster
2005-11-04 8:14 ` Neil Bothwick
2005-11-04 13:16 ` John J. Foster
2005-11-04 13:41 ` Peper
2005-11-04 14:30 ` Peper
2005-11-04 13:47 ` Neil Bothwick
2005-11-04 14:05 ` John J. Foster
2005-11-04 15:33 ` Neil Bothwick
2005-11-04 15:14 ` John J. Foster
2005-11-05 0:16 ` John J. Foster
2005-11-05 22:52 ` Neil Bothwick
2005-11-06 0:26 ` John J. Foster
2005-11-06 7:16 ` [gentoo-user] " Francesco Talamona
2005-11-06 13:03 ` John J. Foster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox