Re: [gentoo-user] local.start and sending an email

2005-11-05 Thread 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
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-05 Thread John J. Foster
On Sat, Nov 05, 2005 at 10:52:20PM +, 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 [EMAIL PROTECTED]

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 [EMAIL 
PROTECTED]

-- 
If voting could change anything,
it would be illegal


pgpOVZp7dd9co.pgp
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread 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' [EMAIL PROTECTED]
 
 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
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread John J. Foster
On Fri, Nov 04, 2005 at 08:14:59AM +, 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' [EMAIL PROTECTED]
  
  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


pgpLM4cn4Boa7.pgp
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread Peper
 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



Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread Neil Bothwick
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
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread John J. Foster
On Fri, Nov 04, 2005 at 01:47:55PM +, 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


pgpH6ZPfvUzyf.pgp
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread Peper
 rc-update del boot.
Of course i meant rc-update del local boot.

-- 
Best Regards,
Peper
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread John J. Foster
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


pgpSryQwtBezB.pgp
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread Neil Bothwick
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
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-04 Thread John J. Foster
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


pgpJ1rhRw4yCc.pgp
Description: PGP signature


[gentoo-user] local.start and sending an email

2005-11-03 Thread John J. Foster
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' [EMAIL PROTECTED]

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


pgpHl6GMm3iaY.pgp
Description: PGP signature


Re: [gentoo-user] local.start and sending an email

2005-11-03 Thread Billy Holmes

John J. Foster wrote:

date|mutt -s 'System restarted' [EMAIL PROTECTED]


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



Re: [gentoo-user] local.start and sending an email

2005-11-03 Thread Peper
 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