util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Sadowski <jeff.sadowski@gmail.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: wall logging or run command each post?
Date: Tue, 24 Oct 2017 00:33:01 -0600	[thread overview]
Message-ID: <CAM9ceLi2hNZd2Ny2_40q_zeL-c+ZJmZ711FEL5UEG20e+gMhaQ@mail.gmail.com> (raw)
In-Reply-To: <CAM9ceLiRqGy45GcpO6ai5dA7n8MmMt+ZB9FeAXrZf6sz-KvV2w@mail.gmail.com>

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

  reply	other threads:[~2017-10-24  6:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-10-23 15:14   ` Jeff Sadowski
2017-10-23 15:26     ` Jeff Sadowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM9ceLi2hNZd2Ny2_40q_zeL-c+ZJmZ711FEL5UEG20e+gMhaQ@mail.gmail.com \
    --to=jeff.sadowski@gmail.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).