Linux

Mengatasi Error Logrotate Zimbra “parent directory has insecure permissions”

<p>Di salah satu klien Excellent yang menggunakan Zimbra sebagai sistem email servernya&comma; pernah mengalami kendala dimana konfigurasi logrotate nya tidak berjalan sehingga file zimbra&period;log dan zimbra-stats&period;log nya secara terus menerus aktif dan membesar hingga 12 GB karena menyimpan log dari tanggal 29 Oktober 2018 hingga sekarang 14 Februari 2019 dalam satu file tersebut&period;<&sol;p>&NewLine;<pre>root&commat;proxy1&colon;~&num; ls &sol;var&sol;log&sol;zimbra&ast; -ltrh &NewLine;-rw-r----- 1 syslog adm 0 Jun 10 2018 &sol;var&sol;log&sol;zimbra&period;log-2018061007&period;backup &NewLine;-rw-r--r-- 1 syslog adm 1&period;6M Oct 26 07&colon;58 &sol;var&sol;log&sol;zimbra&period;log&period;4&period;gz &NewLine;-rw-r--r-- 1 syslog adm 1&period;3M Oct 27 08&colon;03 &sol;var&sol;log&sol;zimbra&period;log&period;3&period;gz &NewLine;-rw-r--r-- 1 syslog adm 1&period;6M Oct 28 08&colon;00 &sol;var&sol;log&sol;zimbra&period;log&period;2&period;gz &NewLine;-rw-r--r-- 1 syslog adm 1&period;2M Oct 29 07&colon;39 &sol;var&sol;log&sol;zimbra&period;log&period;1&period;gz &NewLine;<strong>-rw-r--r-- 1 syslog adm 1&period;1G Feb 14 09&colon;48 &sol;var&sol;log&sol;zimbra-stats&period;log &NewLine;-rw-r--r-- 1 syslog adm 12G Feb 14 09&colon;48 &sol;var&sol;log&sol;zimbra&period;log<&sol;strong><&sol;pre>&NewLine;<p>Ketika dicoba di force untuk rotate menggunakan command <strong><em>logrotate -f &sol;etc&sol;logrotate&period;d&sol;zimbra<&sol;em><&sol;strong>&comma; muncul pesan error seperti berikut ini&period;<&sol;p>&NewLine;<pre>error&colon; skipping "&sol;var&sol;log&sol;zimbra&period;log" because parent directory has insecure permissions &lpar;It's world writable or writable by group which is not "root"&rpar; Set "su" directive in config file to tell logrotate which user&sol;group should be used for rotation&period; &NewLine;error&colon; skipping "&sol;var&sol;log&sol;zimbra-stats&period;log" because parent directory has insecure permissions &lpar;It's world writable or writable by group which is not "root"&rpar; Set "su" directive in config file to tell logrotate which user&sol;group should be used for rotation&period; &NewLine;<&sol;pre>&NewLine;<p>Untuk pesan error tersebut biasanya karena adanya permission yang tidak aman untuk hak penulisan pada file tersebut&comma; dimana user selain root bisa mengubah file log tersebut&period;<&sol;p>&NewLine;<h3><span style&equals;"color&colon; &num;0000ff&semi;">&num; Eskalasi<&sol;span><&sol;h3>&NewLine;<p>Untuk eskalasinya bisa tambahkan baris <strong><em>su root root<&sol;em><&sol;strong> untuk memberi tahu logrotate agar menggunakan user&sol;group apa yang digunakan untuk menjalankan rotasi log&period;<&sol;p>&NewLine;<p>Edit file <strong><em>&sol;etc&sol;logrotate&period;d&sol;zimbra<&sol;em><&sol;strong>&comma; kemudian cari section log zimbra&period;log dan zimbra-stats&period;log&comma; dan edit menjadi seperti berikut<&sol;p>&NewLine;<pre>&sol;var&sol;log&sol;zimbra&period;log &lbrace; &NewLine; <strong><span style&equals;"color&colon; &num;ff0000&semi;">su root root<&sol;span><&sol;strong> &NewLine; daily &NewLine; missingok &NewLine; notifempty &NewLine; create 0644 syslog adm &NewLine; postrotate &NewLine; &sol;usr&sol;sbin&sol;service rsyslog restart >&sol;dev&sol;null &vert;&vert; true &NewLine; su - zimbra -c "&sol;opt&sol;zimbra&sol;bin&sol;zmconfigdctl restart" > &sol;dev&sol;null 2>&1 &vert;&vert; true &NewLine; endscript &NewLine; rotate 7 &NewLine; compress &NewLine;&rcub; &NewLine; &NewLine;&sol;var&sol;log&sol;zimbra-stats&period;log &lbrace; &NewLine; <span style&equals;"color&colon; &num;ff0000&semi;"><strong>su root root<&sol;strong><&sol;span> &NewLine; daily &NewLine; missingok &NewLine; notifempty &NewLine; create 0644 syslog adm &NewLine; postrotate &NewLine; &sol;usr&sol;sbin&sol;service rsyslog restart >&sol;dev&sol;null &vert;&vert; true &NewLine; su - zimbra -c "&sol;opt&sol;zimbra&sol;bin&sol;zmconfigdctl restart" > &sol;dev&sol;null 2>&1 &vert;&vert; true &NewLine; endscript &NewLine; rotate 0 &NewLine;&rcub; &NewLine;<&sol;pre>&NewLine;<p>Simpan file tersebut&comma; lalu jalankan logrotate<&sol;p>&NewLine;<pre>&sol;opt&sol;zimbra&sol;libexec&sol;zmsyslogsetup &NewLine;service rsyslog restart &NewLine;logrotate -f &sol;etc&sol;logrotate&period;d&sol;zimbra<&sol;pre>&NewLine;<p>Maka secara otomatis file log yang besar tadi akan langsung berotasi dan digantikan oleh file log yang baru&comma; dan setiap malam logrotate juga melakukan rotasi log kembali dengan lancar tanpa ada kendala error yang sebelumnya&period;<&sol;p>&NewLine;<p>Mungkin cukup sekian&comma; semoga bermanfaat<&sol;p>&NewLine;<div class&equals;"clearfix"><&sol;div>

Rizky Pratama

Rizky Pratama. Tinggal di Bekasi, Jawa Barat. Seorang IT di salah satu perusahaan IT. Pengguna Mac, Linux dan Windows Selain sebagai penulis di blog ini, saya juga penulis di blog saya yang lain, yaitu https://pratama.biz.id

Share
Published by
Rizky Pratama

Recent Posts

Konfigurasi Smarthost/SMTP Relay pada Stalwart

Dalam pengelolaan mail server, terkadang kita tidak ingin email dikirim langsung ke server tujuan. Ada…

2 weeks ago

Cara Ubah Port SSH Pada Ubuntu 26.04 LTS

Pada bulan April 2026 lalu, Ubuntu telah release versi terbaru yaitu Ubuntu 26.04 LTS, sehingga…

2 months ago

Perjalanan Tanpa Arah

Ada satu hal yang ngga akan pernah benar-benar diajarkan kepada kita, yaitu bagaimana cara melanjutkan…

3 months ago

Konfigurasi Iptables Supaya Auto Start Setelah Reboot (Update)

Bermula ketika saya melakukan suatu konfigurasi pada server, saya menerapkan beberapa rule untuk block port,…

3 months ago

Cara Upgrade Nginx ke Versi Terbaru (Latest) pada Ubuntu

Beberapa hari terakhir saya memutuskan untuk upgrade seluruh server Nginx ke versi terbaru setelah muncul…

6 months ago

Tips Zimbra : Cara Export Import Grant Right SendAsDistList

Beberapa waktu lalu saya ada melakukan migrasi dan upgrade sistem email server Zimbra di salah…

6 months ago