Hello all,
I need start program after system booted as root user.
Don’t understand why i am getting error and how to resolve it.
Here is the steps that i followed:
Created service file in /etc/systemd/system/muxponder.serivice as root.
In side file i have :
Hi Vladislav,
Let me ask your help again.
Actually i am trying install kernel driver using this flow.
I create executable file in /usr/local/bin/SeaLight.cmd with following context:
I also placed our driver gendrv.ko in side same directory, and run restorecon on it.
When i executing this command all works, but after boot status that i am getting is bellow, looks like /sbin/insmod can’t access /usr/local/bin/gendrv.ko.
Can you suggest how solve this?
Thanks in advance.
[root@fedora system]# systemctl status muxponder.service
× muxponder.service - Muxponder
Loaded: loaded (/etc/systemd/system/muxponder.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: failed (Result: exit-code) since Mon 2024-04-15 20:18:20 PDT; 37s ago
Duration: 71ms
Process: 748 ExecStart=/usr/local/bin/SeaLight.cmd (code=exited, status=1/FAILURE)
Main PID: 748 (code=exited, status=1/FAILURE)
CPU: 6ms
Apr 15 20:18:20 fedora systemd[1]: Started muxponder.service - Muxponder.
Apr 15 20:18:20 fedora SeaLight.cmd[748]: Start
Apr 15 20:18:20 fedora SeaLight.cmd[748]: DBG 1:>/usr/local/bin/gendrv.ko devices=1 base=00000000 irq=-1 description=digi0:pci?(1.0.0.0)+0:7ffffff:32:2 shared_mem_start=0x040000>
Apr 15 20:18:20 fedora SeaLight.cmd[750]: insmod: ERROR: could not insert module /usr/local/bin/gendrv.ko: Permission denied
Apr 15 20:18:20 fedora systemd[1]: muxponder.service: Main process exited, code=exited, status=1/FAILURE
Apr 15 20:18:20 fedora systemd[1]: muxponder.service: Failed with result 'exit-code'.
Thanks for example.
You mention that it requires updating the kernel to the latest, but in our case we can’t compile the driver with the latest release of the kernel, and we have to stay with the 6.5.6 (I need to confirm this) release.
Does this still work?
I still hope to find a way at boot time to load the driver by running a script from systemd as I can do from terminal.
Thanks,
Have you tried loading that module with sudo modprobe gendrv to see if it will even load?
If not then make sure it can be loaded manually before you attempt to create a file in /etc/modprobe.d to automatically load it.
Once you can load it and test it with manually loading it and are sure it works then add the entries to the file in /etc/modprobe.d.
You would also likely need to load the module, make the entry in /etc/modprobe.d, then also generate a new initramfs image with that module included to be sure it would load at boot time.
Thanks Jeff,
I can load this module using insmod and it works. This is so far what we are doing.
Can you please elaborate on how to generate a new initramfs image.
Also when I load with insmod we are passing arguments as you saw.
Can you comment if I have correctly created the gendrv.conf file and placed gendrv.ko in the correct place.
Thanks a lot.
The information in the gendrv.conf file probably should look much like the command line used with insmod, though I am not certain about differences between using modprobe and insmod. Check the man pages for more details. I suspect that testing with modprobe should be used to confirm the command line structure since modprobe is used during boot with the content of /etc/modprobe.d/. According to the man page modprobe has many more options than insmod.
The man page for modprobe.d shows several ways to use the .conf file. I see this as an example.
options modulename option...
This command allows you to add options to the module modulename (which might be an alias) every time it is inserted into the kernel: whether directly (using modprobe
modulename) or because the module being inserted depends on this module.
The initramfs image is created or replaced with the dracut command. sudo dracut --force in its normal form but according to the man page that can also identify a specific kernel for which the image is to be created.
Looks to me that it should be options gendrv options... all on one line if I am reading the docs properly
Or you may break the line by ending each line to be continued with a \ at the end – so multiple lines are read as a single line by modprobe).
This would result in
options gendrv option option \
option option
which would then appear as one line to modprobe (man modprobe.d shows this)
I am having a problem again loading the same module at boot time on new builded fedora system.
I was able to load module manually: /sbin/insmod gendrv.ko
I checked all application works after I loaded.
I created the file gendrv.conf in /etc/modules-load.d directory with the line gendrv.
I cp gendrv.ko in to /usr/lib/modules/6.5.6-300.fc39.x86_64/gendrv.ko
After boot systemd-modules-load.service gives me following error:
Sep 26 17:00:03 vedge systemd-modules-load[558]: Failed to find module 'gendrv'
Not sure how to fix this.
Hope you can help me one more time.
Thank you.
Thanks again for your help.
Yes this was a problem.
I don’t remember that i did this last time, and i don’t have this in my record.
Will look into it to get more clearance.
Albert,