Bug 29674

Summary: separate pkg for journalctl without systemd?
Product: Sisyphus Reporter: Ivan Zakharyaschev <imz>
Component: systemdAssignee: Alexey Shabalin <shaba>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: enhancement    
Priority: P3 CC: arseny, dheeraj.kotagiri, evg, shaba
Version: unstable   
Hardware: all   
OS: Linux   
Bug Depends on: 29698    
Bug Blocks: 29680    

Description Ivan Zakharyaschev 2013-12-30 00:59:34 MSK
# rpm -qf /bin/journalctl 
systemd-201-alt1.M70P.1
# 

Can journalctl be useful without systemd? For querying some "foreign" journals on a system without systemd?

If yes, then it would be nice to have it in a separate subpackage.

Is it true that journalctl is used only for "querying" as the manpage tells us in the summary? So that systemd doesn't really depend on journalctl when running? (It only writes, bu doesn't read the journal.)

Another convenience of a separate journalctl package without strict inter-dependencies with the systemd package would be the possibility to install a newer version of journalctl in a stable system (like p7) if one wants to use its new querying options without running into systemd's new bugs.

If a new version of systemd is incompatible with some old version of journalctl, the systemd package could declare a conflict with the old version of journalctl to force its update.

What do you think about this?
Comment 1 Ivan Zakharyaschev 2014-01-02 07:27:00 MSK
Hmm, I've just tried to do the splitting, but hit a problem: I wanted to allow non-strict matching between the version-releases of systemd and journalctl, but exactly this is not allowed for dependecies by rpmbuild -- http://lists.altlinux.org/pipermail/devel/2013-January/196533.html .

I've done it like this:

# /*bin/journalctl is in a subpackage.
# We want to be able to install a new journalctl and use the old (stable) systemd.
Requires: journalctl >= %version-%release
# We (our post-script) expect it to be at this path; it may change in future:
Requires: /bin/journalctl

This was optimized into 1 strict dependency.

Well, I'll try to express this with Conflicts now:

# We want to be able to install a new journalctl and use the old (stable) systemd.
Conflicts: journalctl < %version-%release
# We (our post-script) expect it to be at this path; it may change in future:
Requires: /bin/journalctl

Let me see whether this will work...
Comment 2 Ivan Zakharyaschev 2014-01-02 19:52:54 MSK
Finally, the problem with automatic strict deps was solved by writing explicit

# We want to be able to install a new journalctl and use the old (stable) systemd.
Conflicts: journalctl < %version-%release
# We (our post-script) expect it to be at this path; it may change in future:
Requires(post): /sbin/journalctl
Requires: /sbin/journalctl

The Requires(post) overwrites the implicit Requires(post) from find-requires, and thus is not converted into a strict dep automatically -- in accordance with http://lists.altlinux.org/pipermail/devel/2013-January/196552.html .

The split packages for p7/t7 and Sisyphus are in my repo http://repo.or.cz/w/systemd_ALT/systemd_imz.git (mirror: https://gitorious.org/altlinux/systemd/ ) -- branches t7 and sisyphus.

I've tested the upgrade on p7 (Simply Linux) to the split p7 packages, and then the installation of journalctl pkg for Sisyphus (new version). It works.

So, these modifications can be merged into ALT's p7/t7 and Sisyphus.
Comment 3 Ivan Zakharyaschev 2014-01-02 22:03:28 MSK
My tag alt1.M70P.3 is for p7/t7, and 208-alt4 is for Sisyphus.

(These releases also declare the appropriate file conflicts between the new split pkgs and the old unsplit, which would correctly work in p7/t7, Sisyphus, and when installing journalctl from Sisyphus in p7/t7.)
Comment 4 Repository Robot 2014-01-10 08:14:59 MSK
systemd-1:208-alt4 -> sisyphus:

* Thu Jan 02 2014 Ivan Zakharyaschev <imz@altlinux> 1:208-alt4
- declare the file conflicts with systemd pkgs before the split of journalctl
  (Epoch 1 for the split pkg, so that the new split journalctl from Sisyphus 
  or any branches conflicts with Epoch 0 old pkgs)
- declare shaba@ as the maintainer

* Thu Jan 02 2014 Ivan Zakharyaschev <imz@altlinux> 208-alt3
- split journalctl into a separate pkg
  (to be used for querying without systemd) (ALT#29674)
Comment 5 Alexey Shabalin 2014-02-20 17:49:17 MSK
Эх Иван, Иван, нахрена же вы Epoch в спек напихали. Слов нет. Теперь же с этим жить.
Извиняюсь, но  @everybody из acl убираю.
Comment 6 dheeraj 2015-01-29 19:39:32 MSK
i want to use journalctl tool without systend in ubuntu 12.04 PC.
Where will i get spilt package of journalctl and how to install and use.

I cloned from 
http://repo.or.cz/w/systemd_ALT/systemd_imz.git (mirror:
https://gitorious.org/altlinux/systemd/ ) but it resulted in some bash scripts.
i am unable to understand the usage . please explain 

thanks in advance .
Comment 7 Ivan Zakharyaschev 2015-01-30 00:56:51 MSK
(В ответ на комментарий №5)
> Эх Иван, Иван, нахрена же вы Epoch в спек напихали. Слов нет. Теперь же с этим
> жить.
> Извиняюсь, но  @everybody из acl убираю.

Sorry, пропустил это замечание.

Если это вызвало проблемы, очень жаль.

Но интересно: а какие на практике проблемы оказались вызванные Epoch? (Помимо некрасивости spec.)

Я обдумал это дело тогда, и понял, что таким образом, как сделано, будут правильно всякие возможные пути обновления пакетов происходить.

К тому же, семантика этого Epoch ясно формулируется: Epoch до 1 -- не разделённый на подпакеты пакет, Epoch 1 -- разделённый.
Comment 8 Ivan Zakharyaschev 2015-01-30 01:15:15 MSK
(В ответ на комментарий №6)
> i want to use journalctl tool without systend in ubuntu 12.04 PC.
> Where will i get spilt package of journalctl and how to install and use.
> 
> I cloned from 
> http://repo.or.cz/w/systemd_ALT/systemd_imz.git (mirror:
> https://gitorious.org/altlinux/systemd/ ) but it resulted in some bash scripts.
> i am unable to understand the usage . please explain 

No patches are needed for journalctl to be used standalone.

The only tiny problem (being solved here) was packaging it this way for a distro: so that the programs are in separate packages formally.

I can't tell what the situation is in Ubuntu. The things are specifically for ALT distro, not Ubuntu. (ALT even uses a different package format than Ubuntu and Debian, so there is no chance that you could take the packages from ALT.)

But you can simply build journalctl from systemd sources yourself, and use it to read foreign logs.
Comment 9 Ivan Zakharyaschev 2015-01-30 01:19:09 MSK
(В ответ на комментарий №8)
> (В ответ на комментарий №6)
> > i want to use journalctl tool without systend in ubuntu 12.04 PC.
> > Where will i get spilt package of journalctl and how to install and use.
> > 
> > I cloned from 
> > http://repo.or.cz/w/systemd_ALT/systemd_imz.git (mirror:
> > https://gitorious.org/altlinux/systemd/ ) but it resulted in some bash scripts.
> > i am unable to understand the usage . please explain 
> 
> No patches are needed for journalctl to be used standalone.
> 
> The only tiny problem (being solved here) was packaging it this way for a
> distro: so that the programs are in separate packages formally.
> 
> I can't tell what the situation is in Ubuntu. The things are specifically for
> ALT distro, not Ubuntu. (ALT even uses a different package format than Ubuntu
> and Debian, so there is no chance that you could take the packages from ALT.)
> 
> But you can simply build journalctl from systemd sources yourself, and use it
> to read foreign logs.

Or learn how to prepare .deb packages for Ubuntu (or Debian), and modify the package from Ubuntu so that it is split. Then you can install your modified package, publish it, and perhaps submit your changes to Ubuntu.
Comment 10 Ivan Zakharyaschev 2015-01-30 11:34:36 MSK
(В ответ на комментарий №8)
> (В ответ на комментарий №6)
> > i want to use journalctl tool without systend in ubuntu 12.04 PC.
> > Where will i get spilt package of journalctl and how to install and use.

> But you can simply build journalctl from systemd sources yourself, and use it
> to read foreign logs.

Another variant: take the .deb package fro Ubuntu, extract journalctl from this .deb archive, and use it. (You also need to make sure that all the libs that it requires are installed: preferrably, as Ubuntu packages, or extracted from a .deb.)