How to rotate rundeck service log

289 views
Skip to first unread message

venka...@gmail.com

unread,
Sep 17, 2020, 3:05:51 AM9/17/20
to rundeck-discuss
We have rundeck 3.03 opensource and installed through WAR .
Let me know any option to rotate service log 

Xavier Humbert

unread,
Sep 17, 2020, 3:48:37 AM9/17/20
to rundeck...@googlegroups.com, venka...@gmail.com
What is your OS ?

Cheers

Xavier

On 17/09/2020 09:05, venka...@gmail.com wrote:
> We have rundeck 3.03 opensource and installed through WAR .
> Let me know any option to rotate service log
> --
> You received this message because you are subscribed to the Google
> Groups "rundeck-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to rundeck-discu...@googlegroups.com
> <mailto:rundeck-discu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rundeck-discuss/d2423189-34ca-4d2c-b5eb-e8803260ea89n%40googlegroups.com
> <https://groups.google.com/d/msgid/rundeck-discuss/d2423189-34ca-4d2c-b5eb-e8803260ea89n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Xavier Humbert
CRT Supervision et Exploitation de Niveau 1
Rectorat de Nancy-Metz
03 83 86 27 39

OpenPGP_0xEFD131080235DC69_and_old_rev.asc
OpenPGP_signature

rac...@rundeck.com

unread,
Sep 17, 2020, 7:27:26 AM9/17/20
to rundeck-discuss
Hi Venkat,

That's requested here. Meanwhile, you can use logrotate like this.

Here you can see a good example of logrotate use.

Hope it helps!

venka...@gmail.com

unread,
Sep 17, 2020, 8:06:50 AM9/17/20
to rundeck-discuss
CentSO 7 

venka...@gmail.com

unread,
Sep 17, 2020, 8:10:25 AM9/17/20
to rundeck-discuss
I tried like this but no luck .


/opt/rundeck/tgt/var/log/service.log {

  copytruncate

  daily

  missingok

  rotate 7

  compress

  delaycompress

  notifempty

  create 777 root root

}

Anything wrong here ?

Felipe Gutierrez

unread,
Sep 17, 2020, 8:18:59 AM9/17/20
to rundeck...@googlegroups.com
Any message on the messages on the os side? 

To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/676cbbbb-d772-42d5-993f-30f0c4a0855cn%40googlegroups.com.

rac...@rundeck.com

unread,
Sep 17, 2020, 8:41:25 AM9/17/20
to rundeck-discuss
Hi Venkat,

Your logrotate definition is set to rotate the service.log file daily, what error are you seeing?

Regards.

venka...@gmail.com

unread,
Sep 17, 2020, 10:17:26 AM9/17/20
to rundeck-discuss
am not seeing any error log message other than below message

logrotate: ALERT exited abnormally with [1]


rac...@rundeck.com

unread,
Sep 17, 2020, 11:20:13 AM9/17/20
to rundeck-discuss

Hi Venkat,

On Centos 7 I did an example based on this.

1) Go to /etc/logrotate.d folder and create a new file named “rundeck”, put the following content on that file:

/path/to/your/service.log {
  su root root
  copytruncate
  daily
  missingok
  rotate 7
  compress
  delaycompress
  notifempty
  create 640 root adm
}

2) Test the logrotate file with logrotate --force /etc/logrotate.d/rundeck. That command helps you to identify if your configuration or the file has some problem. If both are ok you can see the log rotated.

Hope it helps!

fgutierr...@gmail.com

unread,
Sep 17, 2020, 12:56:44 PM9/17/20
to rundeck-discuss
For the error >> logrotate: ALERT exited abnormally with [1]

Check if selinux is enabled.  if so,  disable it for a day or two to check if the log rotation is working. 

venka...@gmail.com

unread,
Oct 6, 2020, 7:35:18 AM10/6/20
to rundeck-discuss
Hi Rac , 

When i run manually with logrotate --force /etc/logrotate.d/rundeck command its working as expected but not happening automatically ..Any cron scheduling required for this ..?  .  

rac...@rundeck.com

unread,
Oct 6, 2020, 7:43:37 AM10/6/20
to rundeck-discuss

Hi Venkat,

logrotate --force /etc/logrotate.d/rundeck it’s just to test your rules, if are well defined, logrotate should work automatically.

You can check more information about logrotate here. And here a real example on Rundeck logs.

Regards.

venka...@gmail.com

unread,
Oct 7, 2020, 12:31:08 AM10/7/20
to rundeck-discuss
hi Rac , 

Am using below log rotate file and not finding any issue ..

/opt/rundeck/tgt/var/log/service.log {

  su root root

  copytruncate

  daily

  missingok

  rotate 7

  compress

  delaycompress

  dateext

  dateformat -%Y%m%d

  notifempty

  create 640 root adm

}

Are you seeing any configuration issue here ..? Any suggestion ..?

rac...@rundeck.com

unread,
Oct 7, 2020, 9:46:53 AM10/7/20
to rundeck-discuss

Hi Venkat,

I did a little test to rotate Rundeck service.log hourly on Centos 7 and works well.

I created rundeck file at /etc/logrotate.d/ path:

/var/log/rundeck/service.log {
  su root root
  copytruncate
  hourly
  missingok
  rotate 7
  compress
  delaycompress
  notifempty
  create 640 root adm
}

Following this, I enabled the hourly logrotate conf (needed for hourly, the daily logrotate configuration it’s already set on /etc/cron.daily path by default, maybe it’s not set in your case?) , and works as expected, take a look.

Check carefully the logrotate configuration on your OS.

Hope it helps!

Reply all
Reply to author
Forward
0 new messages