# Replacement package for "daemonize" in Rocky Linux 9

**URL:** <https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 5, 2023, 3:43pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444 "2023-01-05T15:43:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![blionnel15](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@blionnel15](https://forums.rockylinux.org/u/blionnel15)\
**Post date:** [January 5, 2023, 3:43pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/1 "2023-01-05T15:43:27Z")

</div>

Hi,

I am trying to update an ansible playbook by including Rocky Linux 9 servers.  
I have a list of rhel 8 server packages that need to be install on those Rocky 9 servers.  
In this list I have the “daemonize” package and I am not able to find on the web the replacement package for Rocky Linux 9 release.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [January 5, 2023, 4:14pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/2 "2023-01-05T16:14:32Z")

</div>

`daemonize` in EL8 was packaged by EPEL repository, so you could make a request to EPEL for them to package this for EL9.

> **[EPEL Package Request](https://docs.fedoraproject.org/en-US/epel/epel-package-request/)**
>
> Learn more about Fedora Linux, the Fedora Project & the Fedora Community.

Another alternative is to download the daemonize src rpm from Fedora: [Overview - rpms/daemonize - src.fedoraproject.org](https://src.fedoraproject.org/rpms/daemonize)

For example, the src.rpm I downloaded from Fedora 36: [https://kojipkgs.fedoraproject.org//packages/daemonize/1.7.8/3.fc36/src/daemonize-1.7.8-3.fc36.src.rpm](https://kojipkgs.fedoraproject.org//packages/daemonize/1.7.8/3.fc36/src/daemonize-1.7.8-3.fc36.src.rpm)

Of which I then installed and ran mock to build the rpm myself:

```auto
mock daemonize-1.7.8-3.fc36.src.rpm

```

this way, you can at least build it yourself and use it, at least until it is requested and appears in EPEL.

```auto
Wrote: /builddir/build/RPMS/daemonize-debuginfo-1.7.8-3.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/daemonize-1.7.8-3.el9.x86_64.rpm
Wrote: /builddir/build/RPMS/daemonize-debugsource-1.7.8-3.el9.x86_64.rpm
Finish: rpmbuild daemonize-1.7.8-3.fc36.src.rpm
Finish: build phase for daemonize-1.7.8-3.fc36.src.rpm
INFO: Done(daemonize-1.7.8-3.fc36.src.rpm) Config(default) 2 minutes 46 seconds
INFO: Results and/or logs in: /var/lib/mock/rocky+epel-9-x86_64/result
Finish: run

[ian@rocky9 ~]$ ls /var/lib/mock/rocky+epel-9-x86_64/result/
build.log daemonize-debuginfo-1.7.8-3.el9.x86_64.rpm installed_pkgs.log
daemonize-1.7.8-3.el9.src.rpm daemonize-debugsource-1.7.8-3.el9.x86_64.rpm root.log
daemonize-1.7.8-3.el9.x86_64.rpm hw_info.log state.log

```

and package install:

```auto
[root@rocky9 result]# dnf localinstall daemonize-1.7.8-3.el9.x86_64.rpm 
Last metadata expiration check: 4:43:42 ago on Thu 05 Jan 2023 12:38:20 PM CET.
Dependencies resolved.
====================================================================================================
 Package Architecture Version Repository Size
====================================================================================================
Installing:
 daemonize x86_64 1.7.8-3.el9 @commandline 24 k

Transaction Summary
====================================================================================================
Install 1 Package

Total size: 24 k
Installed size: 36 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing : 1/1 
  Installing : daemonize-1.7.8-3.el9.x86_64 1/1 
  Running scriptlet: daemonize-1.7.8-3.el9.x86_64 1/1 
  Verifying : daemonize-1.7.8-3.el9.x86_64 1/1 

Installed:
  daemonize-1.7.8-3.el9.x86_64                                                                      

Complete!

```

```auto
[root@rocky9 result]# daemonize --help
daemonize: illegal option -- -
Bad option: --
daemonize, version 1.7.8
Usage: daemonize [OPTIONS] path [arg] ...

OPTIONS

-a Append to, instead of overwriting, output files. Ignored 
               unless -e and/or -o are specified.
-c <dir> Set daemon's working directory to <dir>.
-e <stderr> Send daemon's stderr to file <stderr>, instead of /dev/null.
-E var=value Pass environment setting to daemon. May appear multiple times.
-o <stdout> Send daemon's stdout to file <stdout>, instead of /dev/null.
-p <pidfile> Save PID to <pidfile>.
-u <user> Run daemon as user <user>. Requires invocation as root.
-l <lockfile> Single-instance checking using lockfile <lockfile>.
-v Issue verbose messages to stdout while daemonizing.

```

---

<div class="post-metadata">

**Author:** ![blionnel15](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@blionnel15](https://forums.rockylinux.org/u/blionnel15)\
**Post date:** [January 5, 2023, 5:44pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/3 "2023-01-05T17:44:41Z")

</div>

thanks for the numerous suggestions.  
I will explore each one of them and try to make the best choice for my use case.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [January 5, 2023, 7:27pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/4 "2023-01-05T19:27:31Z")

</div>

It’s also worth asking yourself why it’s not in Rocky 9. Maybe there’s a newer better way.

---

<div class="post-metadata">

**Author:** ![mstauber](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/mstauber/32/8_2.png) [@mstauber](https://forums.rockylinux.org/u/mstauber)\
**Post date:** [January 7, 2023, 6:30pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/5 "2023-01-07T18:30:43Z")

</div>

As you can see from the output you’ve got: All parameters of the “daemonize” binary have a single dash. You tried --help (two dashes). And the shown helptext doesn’t list -h either, but you can see what options are there.

As gerry66uk hinted: These days there are much better options available out of the box in Systemd.

Say you have a binary that can run as a daemon? You want to run it as a system service, chrooted, not as “root” but as an unprivileged user? Here is a sample Systemd Unit-File for that.

```auto
]# cat /usr/lib/systemd/system/monitor.service 
[Unit]
Description=Monitor
Documentation=man:monitor(8)
After=network-online.target
Requires=network-online.target

[Service]
Type=forking
#Type=simple
EnvironmentFile=-/etc/sysconfig/monitor
ExecStartPre=-/usr/sausalito/bin/monitor_prep.sh
ExecStart=/usr/bin/monitor -c /etc/monitor/monitor.conf -p /run/monitor.pid $OPTIONS
PIDFile=/run/monitor.pid
Restart = on-failure

User=monitor
Group=monitor

PrivateTmp=true
NonBlocking=yes
# this will make /usr /boot /etc read only for service
ProtectSystem=full
ProtectHome=no
PrivateDevices=true

[Install]
WantedBy=multi-user.target

```

Just a suggestion. Other than that: Daemonize should still work fine on EL9.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [January 7, 2023, 6:46pm UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/6 "2023-01-07T18:46:31Z")

</div>

> [@mstauber](#):
>
> As you can see from the output you’ve got: All parameters of the “daemonize” binary have a single dash. You tried --help (two dashes). And the shown helptext doesn’t list -h either, but you can see what options are there.

Yeah, I think my copy from the console didn’t work too good, since I tried `--help` first, and then `-h` to get the results. The main thing was just really to show that the mock build that I did, built OK and then was installable, and to show it works from the console. I could fix my post for that, but then our subsequent posts wouldn’t make sense 🙂 , so I’ll leave it as is and just add that the command should have been:

```auto
daemonize -h

```

everytime I use `-h` then it tells me to use `--help`. Would be great if they could decide on a standard of `-h` or `--help` or at least allow both.

---

<div class="post-metadata">

**Author:** ![blionnel15](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@blionnel15](https://forums.rockylinux.org/u/blionnel15)\
**Post date:** [January 9, 2023, 9:44am UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/7 "2023-01-09T09:44:01Z")

</div>

Hi,  
I was also able to build and install the daemonize package like @iwalker did on my Rocky 9 server.  
As @mstauber showed I understand why it is not in the EPEL repository for Rocky 9.  
Thanks for the suggestions and explanations.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:28am UTC](https://forums.rockylinux.org/t/replacement-package-for-daemonize-in-rocky-linux-9/8444/8 "2023-08-25T03:28:51Z")

</div>


