1 00:00:06,600 --> 00:00:08,760 - Depending on the settings or your configuration 2 00:00:08,760 --> 00:00:11,280 you may find that the systemd journal 3 00:00:11,280 --> 00:00:14,190 is not persistent on your distribution, 4 00:00:14,190 --> 00:00:15,363 but you can manage it. 5 00:00:16,380 --> 00:00:19,920 Manage it through /etc/systemd/journald.conf, 6 00:00:19,920 --> 00:00:23,250 and have a look at the parameter storage is auto. 7 00:00:23,250 --> 00:00:24,840 If that parameter is set, 8 00:00:24,840 --> 00:00:26,880 then a persistent journal will be created 9 00:00:26,880 --> 00:00:29,553 after creating a directory /var/log/journal. 10 00:00:30,420 --> 00:00:32,700 After making the journal persistent 11 00:00:32,700 --> 00:00:35,610 you can restart your system, that's the easiest way. 12 00:00:35,610 --> 00:00:37,890 After the reboot, it will be persistent. 13 00:00:37,890 --> 00:00:39,420 But if you don't want to reboot 14 00:00:39,420 --> 00:00:41,670 and you want it to be persistent immediately, 15 00:00:41,670 --> 00:00:43,740 then you can use systemctl restart 16 00:00:43,740 --> 00:00:46,410 systemd-journal-flush.service, 17 00:00:46,410 --> 00:00:48,120 and that will trigger systemd 18 00:00:48,120 --> 00:00:50,610 to reload the journal configuration 19 00:00:50,610 --> 00:00:53,370 and create the persistent journal for you. 20 00:00:53,370 --> 00:00:54,393 Let's check it out. 21 00:00:57,060 --> 00:01:01,380 So first on the CentOS system I'm typing journalctl, 22 00:01:01,380 --> 00:01:03,458 where you can see that the journal 23 00:01:03,458 --> 00:01:06,300 was created February 21st, 8:04, 24 00:01:06,300 --> 00:01:08,613 and I can tell you that was my last reboot. 25 00:01:09,540 --> 00:01:12,526 So if we investigate this 26 00:01:12,526 --> 00:01:14,907 /etc/systemd/journald.conf configuration file, 27 00:01:22,560 --> 00:01:26,610 there you can see the storage is auto option. 28 00:01:26,610 --> 00:01:28,680 So the storage is auto option is here, 29 00:01:28,680 --> 00:01:30,210 we don't need to change it. 30 00:01:30,210 --> 00:01:33,600 The only thing we need to do, we need to go to /var/log, 31 00:01:33,600 --> 00:01:37,770 and in /var/log we need to create a sub-directory journal, 32 00:01:37,770 --> 00:01:39,303 so mkdir journal. 33 00:01:40,560 --> 00:01:42,900 Now the funny thing is that you might think 34 00:01:42,900 --> 00:01:46,170 systemctl daemon-reload will pick it up 35 00:01:46,170 --> 00:01:49,320 'cause in most cases systemctl daemon-reload 36 00:01:49,320 --> 00:01:50,283 does pick it up. 37 00:01:51,360 --> 00:01:53,640 But as you can see, it's not happening. 38 00:01:53,640 --> 00:01:57,310 So we need systemctl restart 39 00:01:58,219 --> 00:02:03,219 systemd-journal-flush.service. 40 00:02:03,900 --> 00:02:06,330 And now if you use your ls on journal again, 41 00:02:06,330 --> 00:02:09,510 there you can see a sub-directory has been created. 42 00:02:09,510 --> 00:02:11,730 This is your persistent journal. 43 00:02:11,730 --> 00:02:15,360 There's no need to worry about file size or anything, 44 00:02:15,360 --> 00:02:17,430 systemd comes default parameters 45 00:02:17,430 --> 00:02:18,990 that ensure that the journal 46 00:02:18,990 --> 00:02:22,710 will never be able to fill up your complete file system. 47 00:02:22,710 --> 00:02:25,260 So for now, we have made the journal persistent. 48 00:02:25,260 --> 00:02:28,173 Let's go check out some more facts about our syslog.