I'm running CentOS 6.8 and use bash. I would like a warning to appear to the user who runs the command "service httpd restart"
E.g.
I looked into it a little but am not sure of the best approach. Aliases I believe are only one word, maybe aliasing the existing 'service' to a script which checks for the 'httpd restart' arguments?
I read shell functions are preferred over aliases, could a shell function do this? I wasn't sure if the shell function went in .bashrc and also needed an alias to work?
I also read something about precmd() and preexec() functionality for bash, but wasn't sure if that would be required, or work, for this case?
Other possibility, modify /sbin/service or /etc/init.d/httpd?
Thanks for any info,
sg
---------- Post updated at 11:49 AM ---------- Previous update was at 08:23 AM ----------
I was able to use this:
found here -- within the restart case statement in /etc/init.d/httpd, commenting the original stop / start commands -- it seems OK. I still appreciate any suggestion that is considered cleaner.
Thanks,
sg
Moderator's Comments:
Please use CODE tags correctly as required by forum rules!
Last edited by RudiC; 03-16-2017 at 04:11 PM..
Reason: Added CODE tags.
Hi
I was wondering if anyone knew the answer to this question?
I am trying to find a way of executing a command if a certain file is created in the same directory.
One way I thought about doing this was to create a FORTRAN program that continually searches for this file. If the file... (8 Replies)
Hi,
Couldnt find the right string" to search for a similar question..so dont know if this has been answered yet...problem is that I want to prepare a command with the requisite parameters passed as a string before executing it...eg: the ls command ..
I can pass "-l", "-t" as parameters and... (12 Replies)
(I will not duplicate my post that I create in 'Programming' ( My post ), but the issue also (after C ) is related to Sun Solaris.)
I need to find the warning-codes to be used in the
#pragma warn..
C-code directives to suppress some compilation warnings.
More desciptive explanation you... (2 Replies)
I am not able to find warn-codes that should be used in
#pragma warn -<code>
directive!:wall:
Could anybody advise where I can see a list of warnings with codes that (as I understand) should be 3-letters code?
I have a pro-C program that produces some warnings.
(Do not advise,... (4 Replies)
Hi All,
I am trying to execute a command using ssh as below.
ssh user123@servername "which ctmcontb"
It is gving the error as below
no ctmcontb in /usr/bin /usr/sbin /opt/sysadm/bin
Not sure from where the PATH is getting picked up.
But When I login direclty to the server I am... (5 Replies)
hi guys
I have suse 11 sp1 and I have a lot of warn file filling / these are under /var/log
there's this big one
-rw-r----- 1 root root 3.9G Feb 1 10:28 warn
warn: ASCII text
and the others that are about 2.5 to 3MB - they are about 130 warn-*.bz2
-rw-r----- 1 root root 3.9G Feb... (2 Replies)
Hello Guys,
I am studying RBAC. So I create a role called sysadm and gave it the "shutdown" profile.
Now when I switch to that role, and execute the shutdown command
$ shutdown -y -g0 -i5
The system responds with :
shutdown: not found
Can anyone help me with this please?... (1 Reply)
Hello,
Can you please look into the below warning messages on AIX sys logs ? is this related to application ? do we need to do anything from OS side ?
we're running WAS on this LPAR.
Feb 12 03:47:48 myserver user:warn|warning IBM Java: JVMJ9VM134W The system fullcore option is set to... (5 Replies)
I'm running CentOS 6.8 and use bash. I would like a warning to appear to the user who runs the command "service httpd restart"
E.g.
# service httpd restart
are you sure y/n
n
#
(or if y, the command executes).
I looked into it a little but am not sure of the best approach. Aliases I ... (1 Reply)
When I tried to configure GNU make, I received:...
WARNING: Your system has neither waitpid() nor wait3().
Without one of these, signal handling is unreliable
You should be aware that running GNU make with -j
could result in erratic behavior.
...
What is that supposed to mean ? my spec:
... (1 Reply)