util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* wall logging or run command each post?
@ 2017-10-18 20:06 Jeff Sadowski
  2017-10-23 10:53 ` Karel Zak
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Sadowski @ 2017-10-18 20:06 UTC (permalink / raw)
  To: util-linux

I would like to know if this feature is built into wall or is there a
good work around?

I would like to configure wall to run a script after anything is posted to wall.

I would also like to log all wall messages. I could easily do that
with a script.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: wall logging or run command each post?
  2017-10-18 20:06 wall logging or run command each post? Jeff Sadowski
@ 2017-10-23 10:53 ` Karel Zak
  2017-10-23 15:04   ` Jeff Sadowski
  2017-10-23 15:14   ` Jeff Sadowski
  0 siblings, 2 replies; 7+ messages in thread
From: Karel Zak @ 2017-10-23 10:53 UTC (permalink / raw)
  To: Jeff Sadowski; +Cc: util-linux

On Wed, Oct 18, 2017 at 02:06:25PM -0600, Jeff Sadowski wrote:
> I would like to know if this feature is built into wall or is there a
> good work around?

wall is usually used by superuser. I guess if you can all "wall" than
you can also call for example logger to write to the system logs. I
don't see reason to merge functionally of these tools together.

> I would like to configure wall to run a script after anything is posted to wall.

Why? Maybe there is better way go get your goal.

> I would also like to log all wall messages. I could easily do that
> with a script.

yes, script(1) is the right way

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: wall logging or run command each post?
  2017-10-23 10:53 ` Karel Zak
@ 2017-10-23 15:04   ` Jeff Sadowski
  2017-10-23 22:20     ` Jeff Sadowski
  2017-10-23 15:14   ` Jeff Sadowski
  1 sibling, 1 reply; 7+ messages in thread
From: Jeff Sadowski @ 2017-10-23 15:04 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

So my best bet is going to be to put

alias wall=/script/wall.sh

in my /etc/bash.bashrc
and any other allowed shell rc's
where my /script/wall.sh does the things I want.
and change any scripts like my /etc/apcupsd/apccontrol
and change its WALL=wall to WALL=/script/wall.sh
as well.

I'll just have to go searching through /etc/ for files containing wall

This will get most things I care about but it might skip messages that
some users may broadcast
should adding the "#!/bin/bash" as the first line to shell scripts
cause the script to use the alias?


On Mon, Oct 23, 2017 at 4:53 AM, Karel Zak <kzak@redhat.com> wrote:
> On Wed, Oct 18, 2017 at 02:06:25PM -0600, Jeff Sadowski wrote:
>> I would like to know if this feature is built into wall or is there a
>> good work around?
>
> wall is usually used by superuser. I guess if you can all "wall" than
> you can also call for example logger to write to the system logs. I
> don't see reason to merge functionally of these tools together.
>
>> I would like to configure wall to run a script after anything is posted to wall.
>
> Why? Maybe there is better way go get your goal.
>
>> I would also like to log all wall messages. I could easily do that
>> with a script.
>
> yes, script(1) is the right way
>
>     Karel
>
>
> --
>  Karel Zak  <kzak@redhat.com>
>  http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: wall logging or run command each post?
  2017-10-23 10:53 ` Karel Zak
  2017-10-23 15:04   ` Jeff Sadowski
@ 2017-10-23 15:14   ` Jeff Sadowski
  2017-10-23 15:26     ` Jeff Sadowski
  1 sibling, 1 reply; 7+ messages in thread
From: Jeff Sadowski @ 2017-10-23 15:14 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

One of the reasons I added this request:

My default desktop is XFCE and it uses gnome-terminals. I don't get
wall messages in gnome-terminals and I wanted a simple way to get wall
messages to my screen I was thinking about using notify-send

On Mon, Oct 23, 2017 at 4:53 AM, Karel Zak <kzak@redhat.com> wrote:
> On Wed, Oct 18, 2017 at 02:06:25PM -0600, Jeff Sadowski wrote:
>> I would like to know if this feature is built into wall or is there a
>> good work around?
>
> wall is usually used by superuser. I guess if you can all "wall" than
> you can also call for example logger to write to the system logs. I
> don't see reason to merge functionally of these tools together.
>
>> I would like to configure wall to run a script after anything is posted to wall.
>
> Why? Maybe there is better way go get your goal.
>
>> I would also like to log all wall messages. I could easily do that
>> with a script.
>
> yes, script(1) is the right way
>
>     Karel
>
>
> --
>  Karel Zak  <kzak@redhat.com>
>  http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: wall logging or run command each post?
  2017-10-23 15:14   ` Jeff Sadowski
@ 2017-10-23 15:26     ` Jeff Sadowski
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Sadowski @ 2017-10-23 15:26 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

Another reason was I was going to get the email addresses of everyone
having a process running on my machines and send them all emails of
the wall messages as well.
Doesn't shutdown typically send a wall message? It is messages like
these that I would like to get emails to all my users.

My machines are connected to Active Directory so I can use ldapsearch
to get their email addresses.

On Mon, Oct 23, 2017 at 9:14 AM, Jeff Sadowski <jeff.sadowski@gmail.com> wrote:
> One of the reasons I added this request:
>
> My default desktop is XFCE and it uses gnome-terminals. I don't get
> wall messages in gnome-terminals and I wanted a simple way to get wall
> messages to my screen I was thinking about using notify-send
>
> On Mon, Oct 23, 2017 at 4:53 AM, Karel Zak <kzak@redhat.com> wrote:
>> On Wed, Oct 18, 2017 at 02:06:25PM -0600, Jeff Sadowski wrote:
>>> I would like to know if this feature is built into wall or is there a
>>> good work around?
>>
>> wall is usually used by superuser. I guess if you can all "wall" than
>> you can also call for example logger to write to the system logs. I
>> don't see reason to merge functionally of these tools together.
>>
>>> I would like to configure wall to run a script after anything is posted to wall.
>>
>> Why? Maybe there is better way go get your goal.
>>
>>> I would also like to log all wall messages. I could easily do that
>>> with a script.
>>
>> yes, script(1) is the right way
>>
>>     Karel
>>
>>
>> --
>>  Karel Zak  <kzak@redhat.com>
>>  http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: wall logging or run command each post?
  2017-10-23 15:04   ` Jeff Sadowski
@ 2017-10-23 22:20     ` Jeff Sadowski
  2017-10-24  6:33       ` Jeff Sadowski
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Sadowski @ 2017-10-23 22:20 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Mon, Oct 23, 2017 at 9:04 AM, Jeff Sadowski <jeff.sadowski@gmail.com> wrote:
> So my best bet is going to be to put
>
> alias wall=/script/wall.sh
>
> in my /etc/bash.bashrc
> and any other allowed shell rc's
> where my /script/wall.sh does the things I want.
> and change any scripts like my /etc/apcupsd/apccontrol
> and change its WALL=wall to WALL=/script/wall.sh
> as well.
>
> I'll just have to go searching through /etc/ for files containing wall
>
> This will get most things I care about but it might skip messages that
> some users may broadcast
> should adding the "#!/bin/bash" as the first line to shell scripts
> cause the script to use the alias?
>
This doesn't work so I'm stuck with having to find all scripts and
manually change them
and having to warn users about wall not having this capability

My current wall script looks like so

#!/bin/bash
# filename: /home/scripts/wall.sh
# purpose: to email myself wall messages and to log them
input="$@"
if [ "${input}" = "" ];then
 input=$(cat)
fi
logger -s "from ${BASH_SOURCE[0]} : $@" >/dev/null 2>&1
echo -e "${input}" | mutt -s "wall messages from $(hostname) at
$(date)" jeff.sadowski@gmail.com
echo -e "${input}" | /bin/wall


I'll work on getting it to other users's desktops as well but this all
seems like stuff that should be implemented in wall.
Another alternative is to wrap it and have a post upgrade script look
to see if wall is a symlink pointing to my script and if not move it
to /bin/real.wall and use /bin/real.wall in my scripts. I'm thinking
that would be the best.
Now to find the post upgrade scripts for centos, fedora and ubuntu.

>
> On Mon, Oct 23, 2017 at 4:53 AM, Karel Zak <kzak@redhat.com> wrote:
>> On Wed, Oct 18, 2017 at 02:06:25PM -0600, Jeff Sadowski wrote:
>>> I would like to know if this feature is built into wall or is there a
>>> good work around?
>>
>> wall is usually used by superuser. I guess if you can all "wall" than
>> you can also call for example logger to write to the system logs. I
>> don't see reason to merge functionally of these tools together.
>>
>>> I would like to configure wall to run a script after anything is posted to wall.
>>
>> Why? Maybe there is better way go get your goal.
>>
>>> I would also like to log all wall messages. I could easily do that
>>> with a script.
>>
>> yes, script(1) is the right way
>>
>>     Karel
>>
>>
>> --
>>  Karel Zak  <kzak@redhat.com>
>>  http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: wall logging or run command each post?
  2017-10-23 22:20     ` Jeff Sadowski
@ 2017-10-24  6:33       ` Jeff Sadowski
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Sadowski @ 2017-10-24  6:33 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

no good way to implement post upgrade scripts at least not in fedora.
I'll post a thing on the fedoraforum and ask the developers but I
can't get its /etc/yum/post-action/my_action working after reading the
docs and all. Complicated as hell I hate having to create crontabs to
make sure things are correct.

On Mon, Oct 23, 2017 at 4:20 PM, Jeff Sadowski <jeff.sadowski@gmail.com> wrote:
> On Mon, Oct 23, 2017 at 9:04 AM, Jeff Sadowski <jeff.sadowski@gmail.com> wrote:
>> So my best bet is going to be to put
>>
>> alias wall=/script/wall.sh
>>
>> in my /etc/bash.bashrc
>> and any other allowed shell rc's
>> where my /script/wall.sh does the things I want.
>> and change any scripts like my /etc/apcupsd/apccontrol
>> and change its WALL=wall to WALL=/script/wall.sh
>> as well.
>>
>> I'll just have to go searching through /etc/ for files containing wall
>>
>> This will get most things I care about but it might skip messages that
>> some users may broadcast
>> should adding the "#!/bin/bash" as the first line to shell scripts
>> cause the script to use the alias?
>>
> This doesn't work so I'm stuck with having to find all scripts and
> manually change them
> and having to warn users about wall not having this capability
>
> My current wall script looks like so
>
> #!/bin/bash
> # filename: /home/scripts/wall.sh
> # purpose: to email myself wall messages and to log them
> input="$@"
> if [ "${input}" = "" ];then
>  input=$(cat)
> fi
> logger -s "from ${BASH_SOURCE[0]} : $@" >/dev/null 2>&1
> echo -e "${input}" | mutt -s "wall messages from $(hostname) at
> $(date)" jeff.sadowski@gmail.com
> echo -e "${input}" | /bin/wall
>
>
> I'll work on getting it to other users's desktops as well but this all
> seems like stuff that should be implemented in wall.
> Another alternative is to wrap it and have a post upgrade script look
> to see if wall is a symlink pointing to my script and if not move it
> to /bin/real.wall and use /bin/real.wall in my scripts. I'm thinking
> that would be the best.
> Now to find the post upgrade scripts for centos, fedora and ubuntu.
>
>>
>> On Mon, Oct 23, 2017 at 4:53 AM, Karel Zak <kzak@redhat.com> wrote:
>>> On Wed, Oct 18, 2017 at 02:06:25PM -0600, Jeff Sadowski wrote:
>>>> I would like to know if this feature is built into wall or is there a
>>>> good work around?
>>>
>>> wall is usually used by superuser. I guess if you can all "wall" than
>>> you can also call for example logger to write to the system logs. I
>>> don't see reason to merge functionally of these tools together.
>>>
>>>> I would like to configure wall to run a script after anything is posted to wall.
>>>
>>> Why? Maybe there is better way go get your goal.
>>>
>>>> I would also like to log all wall messages. I could easily do that
>>>> with a script.
>>>
>>> yes, script(1) is the right way
>>>
>>>     Karel
>>>
>>>
>>> --
>>>  Karel Zak  <kzak@redhat.com>
>>>  http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-24  6:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 20:06 wall logging or run command each post? Jeff Sadowski
2017-10-23 10:53 ` Karel Zak
2017-10-23 15:04   ` Jeff Sadowski
2017-10-23 22:20     ` Jeff Sadowski
2017-10-24  6:33       ` Jeff Sadowski
2017-10-23 15:14   ` Jeff Sadowski
2017-10-23 15:26     ` Jeff Sadowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).