On 21/02/2014 09:03, Yuri K. Shatroff wrote:
>> Your idea instantly fails as the rc-service author has no idea of what
>> you defined ${SERVICE} to be and no way to determine what it is now.
> 
> Yes, the rc-service author does not have any idea because he is not
> requested to.
> ${SERVICE} obviously comes from `rc-service status ${SERVICE}` .
> The result (e.g. tail -n {$LINES} ${SERVICE}.log) is achieved by:
> 1. putting LINES= in /etc/conf.d/${SERVICE}
> 2. setting up ${SERVICE}.log with syslog. (or putting LOGFILE=... and
> doing `tail -n ${LINES} ${LOGFILE}, or even LAST_LOG_CMD=`mysql -qe
> 'SELECT ... FROM log.log ORDER BY date DESC LIMIT ${LINES}'`, or
> *whatever*)
> 3. adding this `tail -n ...` or whatever call to the init script .
> 4. voila.
> 
> If you feel I'm again entirely wrong please point out why.


The faults with your comments are many, and I'm not going to detail them
as that's not my job. I'm going to let you figure it out for yourself in
production why your entire approach is wrong, and simply leave you with
this:

You violate DRY.

You expect the sysadmin to know they must make changes in a restart
config file when they tweak the syslogger so that somehow the init
script continues to get it right. Trust me, sysadmins are not going to
remember to do that, because expecting them to is off the wall crazy.

I repeat what I and Canek said earlier:

You've never actually DONE any of this in real life, right?


-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to