All of lore.kernel.org
 help / color / mirror / Atom feed
* logrotate and auto start = no
@ 2012-02-15 14:26 Wido den Hollander
  2012-02-15 14:40 ` Sage Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Wido den Hollander @ 2012-02-15 14:26 UTC (permalink / raw)
  To: ceph-devel@vger.kernel.org

Hi,

When "auto start = no" is set for the OSD's, the logs won't get rotated.

I've set this to no so I can easily reboot machines without all OSD's 
starting, I think it's easier with testing or when you replace a broken 
disk.

Anyway, this prevents the logs from being rotated, causing my disks to 
fill up:

/var/log/ceph/*.log {
     rotate 7
     daily
     compress
     sharedscripts
     postrotate
         invoke-rc.d ceph reload >/dev/null || service ceph reload 
 >/dev/null
     endscript
     missingok
}

The init script doesn't touch daemons which have auto start set to no, 
but this also prevents logrotate from doing it's job.

Some suggestions:

1. Don't use the init script for logrotation
2. Modify the init script
3. Add a note in the documentation about this behaviour

I think that logrotation should work regardless the setting of auto start?

What do you think?

Wido

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

* Re: logrotate and auto start = no
  2012-02-15 14:26 logrotate and auto start = no Wido den Hollander
@ 2012-02-15 14:40 ` Sage Weil
  2012-02-15 15:20   ` [PATCH] init: Only check if auto start is disabled when the issued command is "start" Wido den Hollander
  0 siblings, 1 reply; 3+ messages in thread
From: Sage Weil @ 2012-02-15 14:40 UTC (permalink / raw)
  To: Wido den Hollander; +Cc: ceph-devel@vger.kernel.org

On Wed, 15 Feb 2012, Wido den Hollander wrote:
> Hi,
> 
> When "auto start = no" is set for the OSD's, the logs won't get rotated.
> 
> I've set this to no so I can easily reboot machines without all OSD's
> starting, I think it's easier with testing or when you replace a broken disk.
> 
> Anyway, this prevents the logs from being rotated, causing my disks to fill
> up:
> 
> /var/log/ceph/*.log {
>     rotate 7
>     daily
>     compress
>     sharedscripts
>     postrotate
>         invoke-rc.d ceph reload >/dev/null || service ceph reload >/dev/null
>     endscript
>     missingok
> }
> 
> The init script doesn't touch daemons which have auto start set to no, but
> this also prevents logrotate from doing it's job.
> 
> Some suggestions:
> 
> 1. Don't use the init script for logrotation
> 2. Modify the init script

This is my choice.  We can probably just move the check into the 'start' 
block.  It also looks like the auto_start check is doing something weird 
if the value is "mds"... 

> 3. Add a note in the documentation about this behaviour
> 
> I think that logrotation should work regardless the setting of auto start?

Yeah, definitely!

sage


> 
> What do you think?
> 
> Wido
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

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

* [PATCH] init: Only check if auto start is disabled when the issued command is "start"
  2012-02-15 14:40 ` Sage Weil
@ 2012-02-15 15:20   ` Wido den Hollander
  0 siblings, 0 replies; 3+ messages in thread
From: Wido den Hollander @ 2012-02-15 15:20 UTC (permalink / raw)
  To: ceph-devel; +Cc: Wido den Hollander

This still makes sure daemons don't start on boot.

When auto start was disabled it would also prevent logrotate from doing it's job.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
---
 src/init-ceph.in |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/init-ceph.in b/src/init-ceph.in
index 72249f9..2deed19 100644
--- a/src/init-ceph.in
+++ b/src/init-ceph.in
@@ -171,13 +171,6 @@ for name in $what; do
     num=$id
     name="$type.$id"
 
-    get_conf auto_start "" "auto start"
-    if [ -z "$@" ] || [ "$@" = "mds" ]; then
-	if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then
-	    continue
-	fi
-    fi
-
     check_host || continue
 
     get_conf pid_file "/var/run/ceph/$type.$id.pid" "pid file"
@@ -188,17 +181,19 @@ for name in $what; do
     [ -n "$log_dir" ] && do_cmd "mkdir -p $log_dir"
     [ -n "$log_sym_dir" ] && do_cmd "mkdir -p $log_sym_dir"
 
-    # start, and already running?  (do this check early to avoid unnecessary work!)
+    binary="$BINDIR/ceph-$type"
     if [ "$command" = "start" ]; then
+        get_conf auto_start "" "auto start"
+        if [ "$auto_start" = "no" ] || [ "$auto_start" = "false" ] || [ "$auto_start" = "0" ]; then
+            echo "Skipping Ceph $name on $host... auto start is disabled"
+            continue
+        fi
+
 	if daemon_is_running $name ceph-$type $id $pid_file; then
 	    echo "Starting Ceph $name on $host...already running"
 	    continue
 	fi
-    fi
 
-    # binary?
-    binary="$BINDIR/ceph-$type"
-    if [ "$command" = "start" ]; then
 	get_conf copy_executable_to "" "copy executable to"
 	if [ -n "$copy_executable_to" ]; then
 	    scp $binary "$host:$copy_executable_to"
-- 
1.7.5.4


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

end of thread, other threads:[~2012-02-15 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 14:26 logrotate and auto start = no Wido den Hollander
2012-02-15 14:40 ` Sage Weil
2012-02-15 15:20   ` [PATCH] init: Only check if auto start is disabled when the issued command is "start" Wido den Hollander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.