Re: local.start and sending an email

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

John J. Foster-4
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

Neil Bothwick
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

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

John J. Foster-4
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

Piotr "Jaroszyński"
> 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
--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

Neil Bothwick
In reply to this post by John J. Foster-4
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.

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

John J. Foster-4
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

Piotr "Jaroszyński"
In reply to this post by Piotr "Jaroszyński"
> rc-update del boot.
Of course i meant rc-update del local boot.

--
Best Regards,
Peper
--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

John J. Foster-4
In reply to this post by John J. Foster-4
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

Neil Bothwick
In reply to this post by John J. Foster-4
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?

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

John J. Foster-4
In reply to this post by John J. Foster-4
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

Neil Bothwick
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?

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

John J. Foster-4
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

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: local.start and sending an email

ti.liame
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
--
[hidden email] mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Re: local.start and sending an email

John J. Foster-4
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

attachment0 (196 bytes) Download Attachment