Re: [systemd-devel] sd_bus_process() + sd_bus_wait() is it not suitable for application?
Hi, When the busctl command is used to call the method corresponding to this function, the memory used by the process will increase after 65 ~ 70 times. If continue to call, the memory usage will continue to increase. Refer to the method in SYSTEMd. (such as: ListUnits, GetDynamicUsers) Thanks, Byron At 2022-01-22 22:25:35, "Dan Nicholson" wrote: Aren't your leaking reply there? You don't seem to be unreffing it and it's not being returned to someone else to do it either. On Sat, Jan 22, 2022, 3:12 AM www wrote: +Add the implementation code of the method. static int method_load_info(sd_bus_message *message, void *userdata, sd_bus_err *error) { sd_bus_message *reply = NULL; .. r = sd_bus_message_read(message. "r", &xxx); .. r= sd_bus_message_new_return(message, &reply); // .. r = sd_bus_message_open_container(reply, 'a', "()"); r = sd_bus_message_append(reply, "()", xx, xx ,xx ,xx); .. r = sd_bus_message_close_container(reply); ... return sd_bus_send(NULL, reply, NULL); } Thanks, Byron At 2022-01-22 14:16:13, "www" wrote: Dear all, When using sd_bus_process() + sd_bus_wait() to implement the application(Service), call the methods function on the service can obtain the correct information. Run a certain number of times will lead to insufficient memory and memleak does occur. It should not be a problem with the DBUS method, because a single call does not increase memory, it needs to call the method 65 ~ 70 times, and you will see the memory increase. After stopping the call, the memory will not decrease. It seems that it has nothing to do with the time interval when the method is called. code implementation: int main() { .. r = sd_bus_open_system(&bus); ... r = sd_bus_add_object_vtable(bus, ..); .. r= sd_bus_request_name(bus, "xxx.xx.xx.xxx"); .. for( ; ; ) { r = sd_bus_process(bus, NULL); ... r = sd_bus_wait(bus, -1); .. } sd_bus_slot_unref(slot); sd_bus_unref(bus); } thanks, Byron
Re: [systemd-devel] sd_bus_process() + sd_bus_wait() is it not suitable for application?
+Add the implementation code of the method. static int method_load_info(sd_bus_message *message, void *userdata, sd_bus_err *error) { sd_bus_message *reply = NULL; .. r = sd_bus_message_read(message. "r", &xxx); .. r= sd_bus_message_new_return(message, &reply); // .. r = sd_bus_message_open_container(reply, 'a', "()"); r = sd_bus_message_append(reply, "()", xx, xx ,xx ,xx); .. r = sd_bus_message_close_container(reply); ... return sd_bus_send(NULL, reply, NULL); } Thanks, Byron At 2022-01-22 14:16:13, "www" wrote: Dear all, When using sd_bus_process() + sd_bus_wait() to implement the application(Service), call the methods function on the service can obtain the correct information. Run a certain number of times will lead to insufficient memory and memleak does occur. It should not be a problem with the DBUS method, because a single call does not increase memory, it needs to call the method 65 ~ 70 times, and you will see the memory increase. After stopping the call, the memory will not decrease. It seems that it has nothing to do with the time interval when the method is called. code implementation: int main() { .. r = sd_bus_open_system(&bus); ... r = sd_bus_add_object_vtable(bus, ..); .. r= sd_bus_request_name(bus, "xxx.xx.xx.xxx"); .. for( ; ; ) { r = sd_bus_process(bus, NULL); ... r = sd_bus_wait(bus, -1); .. } sd_bus_slot_unref(slot); sd_bus_unref(bus); } thanks, Byron
[systemd-devel] sd_bus_process() + sd_bus_wait() is it not suitable for application?
Dear all, When using sd_bus_process() + sd_bus_wait() to implement the application(Service), call the methods function on the service can obtain the correct information. Run a certain number of times will lead to insufficient memory and memleak does occur. It should not be a problem with the DBUS method, because a single call does not increase memory, it needs to call the method 65 ~ 70 times, and you will see the memory increase. After stopping the call, the memory will not decrease. It seems that it has nothing to do with the time interval when the method is called. code implementation: int main() { .. r = sd_bus_open_system(&bus); ... r = sd_bus_add_object_vtable(bus, ..); .. r= sd_bus_request_name(bus, "xxx.xx.xx.xxx"); .. for( ; ; ) { r = sd_bus_process(bus, NULL); ... r = sd_bus_wait(bus, -1); .. } sd_bus_slot_unref(slot); sd_bus_unref(bus); } thanks, Byron
[systemd-devel] sd_bus_process() + sd_bus_wait() is it not suitable for application?
Dear all, When using sd_bus_process() + sd_bus_wait() to implement the application(Service), call the methods function on the service can obtain the correct information. Run a certain number of times will lead to insufficient memory and memleak does occur. It should not be a problem with the DBUS method, because a single call does not increase memory, it needs to call the method 65 ~ 70 times, and you will see the memory increase. After stopping the call, the memory will not decrease. It seems that it has nothing to do with the time interval when the method is called. code implementation: int main() { .. r = sd_bus_open_system(&bus); ... r = sd_bus_add_object_vtable(bus, ..); .. r= sd_bus_request_name(bus, "xxx.xx.xx.xxx"); .. for( ; ; ) { r = sd_bus_process(bus, NULL); ... r = sd_bus_wait(bus, -1); .. } sd_bus_slot_unref(slot); sd_bus_unref(bus); } thanks, Byron
[systemd-devel] [systemd]: How to set systemd not to generate loop0.device and mtdblockx.device?
Dear all, systemd version: V242 In our system, the whole machine starts too slowly. We want to do some optimization. I found that two services( loop0.device and mtdblock5.device) started slowly. I want to remove them (I personally think our system are not need them). I want to ask you how to avoid generating these two device files and not start them? I am looking forward to your reply. Byron
[systemd-devel] [systemd]: How to set systemd not to generate loop0.device and mtdblockx.device?
Dear all, systemd version: V242 In our system, the whole machine starts too slowly. We want to do some optimization. I found that two services( loop0.device and mtdblock5.device) started slowly. I want to remove them (I personally think our system are not need them). I want to ask you how to avoid generating these two device files and not start them? I am looking forward to your reply. Byron
[systemd-devel] [systemd]: sd-sync lead to kernel panic
Dear all, systemd version: v234 kernel version: 5.1.5 My embedded system uses systemd. Occasionally kernel panic appears in this system. It is found that it is related to sd-sync in systemd. How to analyze this and why? What causes this problem? Or can you see that sd-sync has a problem processing that file or service? If you have any ideas or opinions, or need any specific information, please let me know. Thank you. [ 1664.582102] Unable to handle kernel paging request at virtual address 7f8bba1c [ 1664.589350] pgd = fb46e47e [ 1664.592062] [7f8bba1c] *pgd= [ 1664.595666] Internal error: Oops: 8005 [#1] ARM [ 1664.600558] CPU: 0 PID: 14730 Comm: (sd-sync) Not tainted 5.1.5-yocto-s-dirty-fd96c2b #1 [ 1664.608641] Hardware name: Generic DT based system [ 1664.613444] PC is at 0x7f8bba1c [ 1664.616617] LR is at xas_find_marked+0x94/0x230 [ 1664.621148] pc : [<7f8bba1c>]lr : [<80744690>]psr: 6013 [ 1664.627411] sp : 95eeddb0 ip : ffc0 fp : 95eede4c [ 1664.632627] r10: r9 : r8 : 9e004bcc [ 1664.637847] r7 : 95eedec8 r6 : 95eedec8 r5 : 0001 r4 : [ 1664.644363] r3 : 0002 r2 : r1 : 0004 r0 : a013 [ 1664.650883] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 1664.658006] Control: 00c5387d Table: 95f60008 DAC: 0051 [ 1664.663751] Process (sd-sync) (pid: 14730, stack limit = 0x7a5416e4) [ 1664.670097] Stack: (0x95eeddb0 to 0x95eee000) [ 1664.674452] dda0: 8073815c 80737de8 0001 0002 [ 1664.682628] ddc0: 9e004bcc 801faba8 7fff 8074 [ 1664.690801] dde0: 80b107e0 42139f9a 80b07008 80748498 95eede14 9ac1a120 95f13b00 80b107e0 [ 1664.698972] de00: 9af73540 95eede5c 95eede18 807480c4 8013b46c 9ad45044 80b07008 [ 1664.707146] de20: 95eede54 9e004bcc 95eedec8 95eedec8 801faba8 9e004a90 95eec000 [ 1664.715319] de40: 95eede7c 95eede50 801fd538 801fcf7c 95eede50 95eede50 95eede58 95eede58 [ 1664.723491] de60: 9500 80b07008 9e004bcc 9e004bcc 95eede8c 95eede80 802793c8 801fd4e4 [ 1664.731664] de80: 95eedec4 95eede90 801fd430 802793bc 9ad8d000 8026ac14 95eedf04 95eedea8 [ 1664.739836] dea0: 8026ac14 80b07008 9e004bcc 7fff 7fff 95eedf0c 95eedec8 [ 1664.748008] dec0: 801ec328 801fd3ec 7fff 7fff [ 1664.756182] dee0: 0001 8039002c 80b07008 9ad8d000 8026e4d8 80b075a8 [ 1664.764356] df00: 95eedf34 95eedf10 801ec3a0 801ec2a4 7fff 0001 8027b4fc [ 1664.772528] df20: 9e004af8 95eedf44 95eedf38 8026e4f8 801ec374 95eedf6c 95eedf48 [ 1664.780700] df40: 8027b51c 8026e4e4 00c38f68 0024 801011e4 95eec000 [ 1664.788872] df60: 95eedf94 95eedf70 8026e724 8027b4bc 8010ba08 0001 80b07008 [ 1664.797044] df80: 95eedfa4 95eedf98 8026e798 8026e6c0 95eedfa8 [ 1664.805218] dfa0: 80101000 8026e78c 0002 6ade8c00 [ 1664.813388] dfc0: 00c38f68 0024 7e8d7740 7e8d774c 0003 [ 1664.821562] dfe0: 43759194 7e8d76cc 435e77f0 4307ef9c 6010 [ 1664.829724] Backtrace: [ 1664.832205] [<801fcf70>] (write_cache_pages) from [<801fd538>] (generic_writepages+0x60/0x98) [ 1664.840729] r10: r9:95eec000 r8:9e004a90 r7:801faba8 r6:95eedec8 r5:95eedec8 [ 1664.848549] r4:9e004bcc [ 1664.851107] [<801fd4d8>] (generic_writepages) from [<802793c8>] (blkdev_writepages+0x18/0x1c) [ 1664.859620] r5:9e004bcc r4:9e004bcc [ 1664.863209] [<802793b0>] (blkdev_writepages) from [<801fd430>] (do_writepages+0x50/0xf8) [ 1664.871317] [<801fd3e0>] (do_writepages) from [<801ec328>] (__filemap_fdatawrite_range+0x90/0xd0) [ 1664.880182] r7:7fff r6: r5:7fff r4:9e004bcc [ 1664.885848] [<801ec298>] (__filemap_fdatawrite_range) from [<801ec3a0>] (filemap_fdatawrite+0x38/0x40) [ 1664.895145] r7:80b075a8 r6:8026e4d8 r4: [ 1664.899779] [<801ec368>] (filemap_fdatawrite) from [<8026e4f8>] (fdatawrite_one_bdev+0x20/0x24) [ 1664.908467] r5: r4:9e004af8 [ 1664.912062] [<8026e4d8>] (fdatawrite_one_bdev) from [<8027b51c>] (iterate_bdevs+0x6c/0xc4) [ 1664.920343] [<8027b4b0>] (iterate_bdevs) from [<8026e724>] (ksys_sync+0x70/0xcc) [ 1664.927737] r9:95eec000 r8:801011e4 r7:0024 r6:00c38f68 r5: r4: [ 1664.935482] [<8026e6b4>] (ksys_sync) from [<8026e798>] (sys_sync+0x18/0x20) [ 1664.942436] r4: [ 1664.944980] [<8026e780>] (sys_sync) from [<80101000>] (ret_fast_syscall+0x0/0x54) [ 1664.952455] Exception stack(0x95eedfa8 to 0x95eedff0) [ 1664.957504] dfa0: 0002 6ade8c00 [ 1664.965681] dfc0: 00c38f68 0024 7e8d7740 7e8d774c 0003 [ 1664.973848] dfe0: 43759194 7e8d76cc 435e77f0 4307ef9c [ 1664.978897] Code: bad PC val
[systemd-devel] [systemd-level]: how to config and enable systemd help to create coredump file when the process crashes ?
Dear all, how to config and enable systemd help to create coredump file when the process crashes ? thanks, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [systemd-level]: how to change default timezone in systemd code?
hi Silvio, Thank you for your help. I'll try it locally. thanks, Byron At 2020-04-29 21:27:46, "Silvio Knizek" wrote: >Am Mittwoch, den 29.04.2020, 20:31 +0800 schrieb www: >> Dear All, >> >> I want to change the default timezone in systemd, when it first starts, it >> shows the time zone I want. How can I modify the code in systemd to >> implement the function? >> >> thanks, >> Byron >Hi, > >the default timezone is just the symlink /etc/localtime to >../usr/share/zoneinfo/your/timezone >There is no magic behind this. It can be easy automated and pre- >configured. >You can use systemd-firstboot to set the timezone, too. > >BR >Silvio > >___ >systemd-devel mailing list >systemd-devel@lists.freedesktop.org >https://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [systemd-level]: how to change default timezone in systemd code?
Dear All, I want to change the default timezone in systemd, when it first starts, it shows the time zone I want. How can I modify the code in systemd to implement the function? thanks, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] : How to modify systemd so that the NTP function is disabled when systemd is first started?
hi Michal & Kevin, I find that just shutting down *timesync* service can't solve the problem. Build time also affects system time. My testing process is as follows: 1. systemctl disable systemd-timesyncd systemctl mask systemd-timesyncd 2. timedatectl set-time "2001-11-30 17:36:46" --- This time is set years ago. 3. reboot system View system time after startup: root@demoboard:~# timedatectl Local time: Thu 2020-04-02 17:27:03 CSTThis time is not the latest time, but it is not the time I set. Universal time: Thu 2020-04-02 09:27:03 UTC RTC time: n/a Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: no NTP service: n/a RTC in local TZ: no root@demoboard:~# check the boot log: Apr 02 17:24:52 demoboard systemd[1]: System time before build time, advancing clock. Apr 02 17:25:02 demoboard systemd[1]: logrotate.timer: Not using persistent file timestamp Sat 2020-04-25 13:45:26 CST as it is in the future. Apr 02 17:25:04 demoboard systemd[1]: Reached target Timers. Apr 02 17:25:38 demoboard systemd[1]: Starting Time & Date Service... Apr 02 17:25:40 demoboard systemd[1308]: systemd-timedated.service: ProtectHostname=yes is configured, but the kernel does not support UTS namespaces, ignoring namespace setup. Apr 02 17:25:42 demoboard systemd[1]: Started Time & Date Service. Apr 02 17:26:13 demoboard systemd[1]: systemd-timedated.service: Succeeded. Apr 02 17:27:03 demoboard systemd[1]: Starting Time & Date Service... Apr 02 17:27:03 demoboard systemd[1823]: systemd-timedated.service: ProtectHostname=yes is configured, but the kernel does not support UTS namespaces, ignoring namespace setup. Apr 02 17:27:03 demoboard systemd[1]: Started Time & Date Service. It can be seen from the log that after the TimeSync service is disabled, the latest time is obtained from NTP server, but it is not updated to the system. But the system time has also been modified. I'd like to ask you a few questions: 1. When I shut down the TimeSync service, who modified the system time and according to what? 2. What time does the time in systemd relate to? such as build time。 3. How to realize the time of completely independent control system, no matter TimeSync and build time? thanks, Byron At 2020-04-23 14:25:38, "Michał Zegan" wrote: >As I said, there are symlinks in /etc/systemd/system/*.target.wants that >allows disabling services like this one from starting. It is enough to >remove the one for systemd-timesync.service from multi-user.target.wants >directory. If you can do things via some config files you should also be >able to do this > >W dniu 23.04.2020 o 04:14, www pisze: >> >> hi Michal and Kevin, >> >> We applied systemd to embedded Linux, so we often need to update/flash >> the whole system. When we select disable *time synchronization* >> function, the embedded system will use the time itself. After we update >> the system and restart it, we need the *time synchronization* function >> is disabled. During the whole startup process, there is no automatic >> time synchronization, and *the previous time is used*. Because automatic >> time synchronization may change its original time. (*Because the time >> of the system itself may be different from that of NTP time.*) >> >> There is a *timesyncd.conf* file under the system,can the system >> automatically turn off the time synchronization function by modifying >> this file? >> In this way, when updating, I can save this file to solve this problem. >> >> >> thanks, >> Byron >> >> >> >> >> At 2020-04-17 19:44:48, "Michał Zegan" wrote: >>>I am not quite sure what you mean, but... generally these are symlinks >>>in /etc/systemd/system/multi-user.target.wants/ so you could delete them >>>manually if your intention is to make the actual os image with this >>>disabled from the start... >>> >>>W dniu 17.04.2020 o 12:10, www pisze: >>>> >>>> I mean that this configuration can be preserved, even after I update the >>>> system, this function can be saved. >>>> >>>> thanks, >>>> Byron >>>> >>>> >>>> >>>> >>>> At 2020-04-17 18:06:15, "Kevin P. Fleming" wrote: >>>>>Both of those changes will stop the service from being started, even >>>>>when the system is rebooted. You don't need to run these commands >>>>>every time, running them one time will change the system configuration >>>>>and the service will no longer be started. >
[systemd-devel] [systemd-level]: How to share the same DBUS between the main process and the new thread?
Dear all, I write a new service and the service need wait the signal. At the same time, I need to start a new thread to get information. If the two share the same DBUS, the following problems will arise: terminate called after throwing an instance of 'sdbusplus::exception::SdBusError' what(): sd_bus_call: org.freedesktop.DBus.Error.Timeout: Connection timed out Is there any good way to solve this problem? (I don't want to create a new DBUS in a new thread.) thanks, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] : How to modify systemd so that the NTP function is disabled when systemd is first started?
hi Michal and Kevin, We applied systemd to embedded Linux, so we often need to update/flash the whole system. When we select disable time synchronization function, the embedded system will use the time itself. After we update the system and restart it, we need the time synchronization function is disabled. During the whole startup process, there is no automatic time synchronization, and the previous time is used. Because automatic time synchronization may change its original time. (Because the time of the system itself may be different from that of NTP time.) There is a timesyncd.conf file under the system,can the system automatically turn off the time synchronization function by modifying this file? In this way, when updating, I can save this file to solve this problem. thanks, Byron At 2020-04-17 19:44:48, "Michał Zegan" wrote: >I am not quite sure what you mean, but... generally these are symlinks >in /etc/systemd/system/multi-user.target.wants/ so you could delete them >manually if your intention is to make the actual os image with this >disabled from the start... > >W dniu 17.04.2020 o 12:10, www pisze: >> >> I mean that this configuration can be preserved, even after I update the >> system, this function can be saved. >> >> thanks, >> Byron >> >> >> >> >> At 2020-04-17 18:06:15, "Kevin P. Fleming" wrote: >>>Both of those changes will stop the service from being started, even >>>when the system is rebooted. You don't need to run these commands >>>every time, running them one time will change the system configuration >>>and the service will no longer be started. >>> >>>On Fri, Apr 17, 2020 at 2:52 AM www wrote: >>>> >>>> hi Kevin , >>>> >>>> Thank you very much for you help. But how can I save this way of closing >>>> time synchronization by command after system boot up? After I update the >>>> system, the first time I start it, time synchronization is still enabled >>>> by default. It's not appropriate if I close it alone every time. So when I >>>> need it start every time, this function is off. >>>> >>>> >>>> thanks, >>>> Byron >>>> >>>> >>>> >>>> >>>> >>>> At 2020-04-16 18:28:30, "Kevin P. Fleming" wrote: >>>> >There is no need to modify systemd. >>>> > >>>> >$ systemctl disable systemd-timesyncd >>>> > >>>> >That command will stop the systemd-timesyncd service from being >>>> >started. It may also be necessary to mask it: >>>> > >>>> >$ systemctl mask systemd-timesyncd >>>> > >>>> >On Thu, Apr 16, 2020 at 6:22 AM www wrote: >>>> >> >>>> >> Dear all, >>>> >> >>>> >> I want to ask a question,How to modify systemd so that the NTP function >>>> >> is disabled when systemd is first started? >>>> >> >>>> >> The default state of systend is to synchronize time from NTP. We can >>>> >> use timedatectl command to disable NTP synchronize time. But if I flash >>>> >> the system, the NTP synchronize time function will auto enable. so I >>>> >> want modify the systemd and disable NTP synchronize time in default >>>> >> state. >>>> >> >>>> >> thanks, >>>> >> Byron >>>> >> >>>> >> >>>> >> >>>> >> >>>> >> ___ >>>> >> systemd-devel mailing list >>>> >> systemd-devel@lists.freedesktop.org >>>> >> https://lists.freedesktop.org/mailman/listinfo/systemd-devel >>>> >>>> >>>> >>>> >> >> >> >> >> >> >> ___ >> systemd-devel mailing list >> systemd-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/systemd-devel >> > ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [systemd-level]: how to set property to read only in systemd?
Thank you very much for your help。 thanks, Byron At 2020-04-21 20:53:02, "Lennart Poettering" wrote: >On Di, 21.04.20 19:54, www (ouyangxua...@163.com) wrote: > >> hi Lennart, >> >> >> I mean the DBUS property. >> >> root@demoboard:/# busctl set-property org.freedesktop.DBus >> /org/freedesktop/DBus org.freedesktop.DBus Features as 1 x >> >> Cannot set read-only property -- the default >> >> >> >> >> root@demoboard:/# busctl set-property com.sugon.sensors.DISCRETE >> /com/sugon/sensors/HDD/HDD4_Status xyz.openbmc_project.Sensor.DiscreteAll >> FanDeviceInserted b true -- new add >> >> root@demoboard:/# >> >> >> >> I want the property on Dbus is read only. Just can modify by the >> special method and cannot modify the property directly. How can I >> change it like this? > >Is "com.sugon.sensors.DISCRETE" a service you implemented yourself? >With the sd-bus API? > >In sd-bus you define a writable property in a vtable with the >SD_BUS_WRITABLE_PROPERTY() macro, and a read-only one with >SD_BUS_PROPERTY(). > >But not sure I grok your question properly. > >Lennart > >-- >Lennart Poettering, Berlin ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [systemd-level]: how to set property to read only in systemd?
hi Lennart, I mean the DBUS property. root@demoboard:/# busctl set-property org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus Features as 1 x Cannot set read-only property -- the default root@demoboard:/# busctl set-property com.sugon.sensors.DISCRETE /com/sugon/sensors/HDD/HDD4_Status xyz.openbmc_project.Sensor.DiscreteAll FanDeviceInserted b true -- new add root@demoboard:/# I want the property on Dbus is read only. Just can modify by the special method and cannot modify the property directly. How can I change it like this? thanks, Byron At 2020-04-21 00:43:00, "Lennart Poettering" wrote: >On Mo, 20.04.20 23:00, www (ouyangxua...@163.com) wrote: > >> dear all; >> >> >> How to set some properties in systemd to read-only? Who can give the sample >> code? > >I don't understand the question. Do you mean a D-Bus property? They >generally are read-only for unprivileged bus clients. With a PolicyKit >action configuration you can open them up, but typically unprivileged >clients can't change them. > >Lennart > >-- >Lennart Poettering, Berlin ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [systemd-level]: how to set property to read only in systemd?
dear all; How to set some properties in systemd to read-only? Who can give the sample code? thank, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] : How to modify systemd so that the NTP function is disabled when systemd is first started?
I mean that this configuration can be preserved, even after I update the system, this function can be saved. thanks, Byron At 2020-04-17 18:06:15, "Kevin P. Fleming" wrote: >Both of those changes will stop the service from being started, even >when the system is rebooted. You don't need to run these commands >every time, running them one time will change the system configuration >and the service will no longer be started. > >On Fri, Apr 17, 2020 at 2:52 AM www wrote: >> >> hi Kevin , >> >> Thank you very much for you help. But how can I save this way of closing >> time synchronization by command after system boot up? After I update the >> system, the first time I start it, time synchronization is still enabled by >> default. It's not appropriate if I close it alone every time. So when I need >> it start every time, this function is off. >> >> >> thanks, >> Byron >> >> >> >> >> >> At 2020-04-16 18:28:30, "Kevin P. Fleming" wrote: >> >There is no need to modify systemd. >> > >> >$ systemctl disable systemd-timesyncd >> > >> >That command will stop the systemd-timesyncd service from being >> >started. It may also be necessary to mask it: >> > >> >$ systemctl mask systemd-timesyncd >> > >> >On Thu, Apr 16, 2020 at 6:22 AM www wrote: >> >> >> >> Dear all, >> >> >> >> I want to ask a question,How to modify systemd so that the NTP function >> >> is disabled when systemd is first started? >> >> >> >> The default state of systend is to synchronize time from NTP. We can use >> >> timedatectl command to disable NTP synchronize time. But if I flash the >> >> system, the NTP synchronize time function will auto enable. so I want >> >> modify the systemd and disable NTP synchronize time in default state. >> >> >> >> thanks, >> >> Byron >> >> >> >> >> >> >> >> >> >> ___ >> >> systemd-devel mailing list >> >> systemd-devel@lists.freedesktop.org >> >> https://lists.freedesktop.org/mailman/listinfo/systemd-devel >> >> >> >> ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] : How to modify systemd so that the NTP function is disabled when systemd is first started?
hi Kevin , Thank you very much for you help. But how can I save this way of closing time synchronization by command after system boot up? After I update the system, the first time I start it, time synchronization is still enabled by default. It's not appropriate if I close it alone every time. So when I need it start every time, this function is off. thanks, Byron At 2020-04-16 18:28:30, "Kevin P. Fleming" wrote: >There is no need to modify systemd. > >$ systemctl disable systemd-timesyncd > >That command will stop the systemd-timesyncd service from being >started. It may also be necessary to mask it: > >$ systemctl mask systemd-timesyncd > >On Thu, Apr 16, 2020 at 6:22 AM www wrote: >> >> Dear all, >> >> I want to ask a question,How to modify systemd so that the NTP function is >> disabled when systemd is first started? >> >> The default state of systend is to synchronize time from NTP. We can use >> timedatectl command to disable NTP synchronize time. But if I flash the >> system, the NTP synchronize time function will auto enable. so I want >> modify the systemd and disable NTP synchronize time in default state. >> >> thanks, >> Byron >> >> >> >> >> ___ >> systemd-devel mailing list >> systemd-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] : How to modify systemd so that the NTP function is disabled when systemd is first started?
Dear all, I want to ask a question,How to modify systemd so that the NTP function is disabled when systemd is first started? The default state of systend is to synchronize time from NTP. We can use timedatectl command to disable NTP synchronize time. But if I flash the system, the NTP synchronize time function will auto enable. so I want modify the systemd and disable NTP synchronize time in default state. thanks, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Who deals with the signals of "InterfacesAdded" ?
hi Lennart, Oh! I understand. Thanks you very much. thanks, Byron At 2020-04-10 01:02:17, "Lennart Poettering" wrote: >On Do, 09.04.20 21:27, www (ouyangxua...@163.com) wrote: > >> Dear all, >> >> when I add a new object to dbus, and will send a signal(named >> InterfacesAdded) to "org.freedesktop.Dbus.ObjectManager". I want to >> ask, who is going to handle this signal? What did it do? Where is >> the code? > >Note sure I understand the question. > >On D-Bus signals are broadcast to the bus and anyone who is interested >can subscribe to them. That can be one peer, or many peers or zero >peers. If you are writing a service yourself, and don#t write a >matching client, then of course most likely nobody is going to >subscribe to your signal and it will just be dropped by the broker. > >Lennart > >-- >Lennart Poettering, Berlin ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Who deals with the signals of "InterfacesAdded" ?
Dear all, when I add a new object to dbus, and will send a signal(named InterfacesAdded) to "org.freedesktop.Dbus.ObjectManager". I want to ask, who is going to handle this signal? What did it do? Where is the code? thanks, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Ask some questions about overlay+/dev/mtdblock?
If after uninstalling block4 and block5, I don't want overlay to have direct access to block4 or block5, what should I do? thanks, Byron At 2020-03-02 16:21:17, "www" wrote: Dear all, Systemd is used in the embedded system. and some mounting information is as follows: dev on /dev type devtmpfs (rw,relatime,size=221372k,nr_inodes=55343,mode=755) sys on /sys type sysfs (rw,relatime) proc on /proc type proc (rw,relatime) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) /dev/mtdblock4 on /run/initramfs/ro type squashfs (ro,relatime) /dev/mtdblock5 on /run/initramfs/rw type jffs2 (rw,relatime) cow on / type overlay (rw,relatime,lowerdir=run/initramfs/ro,upperdir=run/initramfs/rw/cow,workdir=run/initramfs/rw/work) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) I have a question, why can overlayfs directly save the information in block4 and block5 (such as the running information of SYSTEMd) after I uninstall block4 and block5 with umount command? Who knows why, or gives some advice? thanks, Byron ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Ask some questions about overlay+/dev/mtdblock?
If after uninstalling block4 and block5, I don't want overlay to have direct access to block4 or block5, what should I do? thanks, Byron At 2020-03-02 16:21:17, "www" wrote: Dear all, Systemd is used in the embedded system. and some mounting information is as follows: dev on /dev type devtmpfs (rw,relatime,size=221372k,nr_inodes=55343,mode=755) sys on /sys type sysfs (rw,relatime) proc on /proc type proc (rw,relatime) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) /dev/mtdblock4 on /run/initramfs/ro type squashfs (ro,relatime) /dev/mtdblock5 on /run/initramfs/rw type jffs2 (rw,relatime) cow on / type overlay (rw,relatime,lowerdir=run/initramfs/ro,upperdir=run/initramfs/rw/cow,workdir=run/initramfs/rw/work) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) I have a question, why can overlayfs directly save the information in block4 and block5 (such as the running information of SYSTEMd) after I uninstall block4 and block5 with umount command? Who knows why, or gives some advice? thanks, Byron ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Ask some questions about overlay+/dev/mtdblock?
Dear all, Systemd is used in the embedded system. and some mounting information is as follows: dev on /dev type devtmpfs (rw,relatime,size=221372k,nr_inodes=55343,mode=755) sys on /sys type sysfs (rw,relatime) proc on /proc type proc (rw,relatime) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) /dev/mtdblock4 on /run/initramfs/ro type squashfs (ro,relatime) /dev/mtdblock5 on /run/initramfs/rw type jffs2 (rw,relatime) cow on / type overlay (rw,relatime,lowerdir=run/initramfs/ro,upperdir=run/initramfs/rw/cow,workdir=run/initramfs/rw/work) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) I have a question, why can overlayfs directly save the information in block4 and block5 (such as the running information of SYSTEMd) after I uninstall block4 and block5 with umount command? Who knows why, or gives some advice? thanks, Byron ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Is there a way to uninstall the file system first and then stop all services?I
Dear all, In systend, the order of power off is: first stop all services, and then uninstall the file system to oldroot. In special applications, if the systemd need to stop most services first (need to keep some services communicating with the outside world over the network), then uninstall the file system to oldroot, then perform special operations(update the system), and then stop other services, then turn off the system. What should I do if I want to achieve such a function?Are there any good suggestions?Or how do you modify the code for systemd? Or is there a way to uninstall the file system first and then stop all services? thanks, Byron___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Antw: Re: how to debug kernel panic which generated by udevadm at systemd?
Dear Mantas and Ulrich, Thank you very much for your help. Because systemd will automatically call this driver, which causes the system to fail to start normally, I have to load the driver in a different way (load it separately), and then debug it. Thanks again for your help. thanks, Byron At 2019-10-16 14:12:35, "Ulrich Windl" wrote: >>>> Mantas Mikulenas schrieb am 15.10.2019 um 20:32 in >Nachricht >: >> On Tue, Oct 15, 2019 at 3:02 PM www wrote: >> >>> Dear all, >>> >>> I add a new driver to kernel, and it probe success. When enter into >>> systemd, the udevadm generate a kernel panic. >>> I want to ask how to debug it and find out where the error occurred? When >>> did udevadm load? What commands are used by udevadm, and what are the >>> specific operations? >>> >> >> There aren't many udevadm calls in systemd... The main one is >> systemd-udev-trigger.service, which calls `udevadm trigger >> --type=subsystems --action=add`, then repeats the same for type=devices. It >> tries to generate coldplug uevents by writing 'add' to each found device's >> /sys/.../uevent file. > >That's waht I guessed: The driver being loaded created siome udev event (with >probably invalid data in it), so when processing those, problems are >triggered. > >I'm not arguing whether all thge components involved are robust enough (to >avoid a kernel panic), but is there a kind of "driver validation tool" (like >inserting the module, querying it's metedata, udev events, removing the module >again, etc.)? > > >Regards, >Ulrich > >> >> (The second is systemd-udev-settle.service, but it is disabled by default >> on most systems and just waits for udev's job queue to empty.) >> >> -- >> Mantas Mikulėnas > > ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Antw: how to debug kernel panic which generated by udevadm at systemd?
Dear Ulrich, Thanks for your suggest. I have added some debug info, but not display. I will add more. I want ask a question, What commands does udevadm in systemd execute and what functions are corresponding to the driver? thanks, Byron At 2019-10-15 20:36:41, "Ulrich Windl" wrote: >Hi! > >I think your driver loads OK, but it is not working correctly. Maybe enable >kernel debug messages and add debug prints to your driver, especially regarding >any queries. I suspect some NULL pointer or empty string being returned. > >Regards, >Ulrich > >>>> www schrieb am 15.10.2019 um 13:46 in Nachricht ><252176e7.9975.16dcf3de51e.coremail.ouyangxua...@163.com>: >> Dear all, >> >> >> I add a new driver to kernel, and it probe success. When enter into systemd, > >> the udevadm generate a kernel panic. >> I want to ask how to debug it and find out where the error occurred? When >> did udevadm load? What commands are used by udevadm, and what are the >> specific operations? >> >> >> [3.291819] pmbus 13-0058: PMBus status register not found >> [3.297940] pmbus 13-0059: PMBus status register not found >> [3.305830] usbcore: registered new interface driver usbhid >> [3.311417] usbhid: USB HID core driver >> [3.326527] aspeed_jtag: driver successfully loaded.--> > >> load the driver success >> [3.335427] NET: Registered protocol family 10 >> [3.345639] Segment Routing with IPv6 >> [3.349995] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver >> [3.357507] NET: Registered protocol family 17 >> [3.362012] 8021q: 802.1Q VLAN Support v1.8 >> [3.379650] printk: console [netcon0] enabled >> [3.384027] netconsole: network logging started >> [3.390140] input: gpio-keys as /devices/platform/gpio-keys/input/input0 >> [3.398913] hctosys: unable to open rtc device (rtc0) >> [3.411203] Freeing unused kernel memory: 1024K >> [3.419068] Checked W+X mappings: passed, no W+X pages found >> [3.424841] Run /init as init process >> rofs = mtd4 squashfs rwfs = mtd5 jffs2 >> [4.392201] jffs2: notice: (681) jffs2_build_xattr_subsystem: complete >> building xattr subsystem, 8 of xdatum (0 unchecked, 1 orphan) and 11 of xref > >> (1 dead, 0 orphan) found. >> [4.448757] overlayfs: upper fs does not support tmpfile. >> [6.760748] systemd[1]: System time before build time, advancing clock. >> [6.893492] systemd[1]: systemd 242-19-gdb2e367+ running in system mode. > >> (+PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK +SYSVINIT -UTMP -LIBCRYPTSETUP >> -GCRYPT -GNUTLS -ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS -KMOD -IDN2 -IDN >> -PCRE2 default-hierarchy=hybrid) >> [6.917878] systemd[1]: Detected architecture arm. >> >> >> Welcome to Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) >> 2.7.0-dev! >> >> >> [7.033813] systemd[1]: Set hostname to . >> [7.769096] systemd[1]: File >> /lib/systemd/system/systemd-journald.service:12 configures an IP firewall >> (IPAddressDeny=any), but the local system does not support BPF/cgroup based > >> firewalling. >> [7.786341] systemd[1]: Proceeding WITHOUT firewalling in effect! (This >> warning is only shown for the first loaded unit using IP firewalling.) >> [8.942114] systemd[1]: /lib/systemd/system/phosphor-ipmi-net@.socket:3: > >> Invalid interface name, ignoring: sys-subsystem-net-devices-%i.device >> [8.982380] systemd[1]: /lib/systemd/system/dbus.socket:4: ListenStream= > >> references a path below legacy directory /var/run/, updating >> /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please >> update the unit file accordingly. >> [9.66] systemd[1]: Reached target Fans Ready. >> [ OK ] Reached target Fans Ready. >> [9.148717] systemd[1]: Created slice >> system-phosphor\x2dipmi\x2dkcs.slice. >> [ OK ] Created slice system-phosphor\x2dipmi\x2dkcs.slice. >> [9.199247] systemd[1]: Listening on udev Kernel Socket. >> [ OK ] Listening on udev Kernel Socket. >> [ OK ] Reached target Slices. >> [ OK ] Created slice system-phosphor\x2dipmi\x2dnet.slice. >> [ OK ] Reached target Remote File Systems. >> [ OK ] Created slice system-mapper\x2dwait.slice. >> [ OK ] Started Forward Password Râ€|uests to Wall Directory Watch. >> [ OK ] Created slice system-phosphor\x2dgpio\x2dmonitor.slice. >> [ OK ] Listening on Journal Socket. >> Mounting Kernel Configuration File System... >> [ OK ]
[systemd-devel] how to debug kernel panic which generated by udevadm at systemd?
Dear all, I add a new driver to kernel, and it probe success. When enter into systemd, the udevadm generate a kernel panic. I want to ask how to debug it and find out where the error occurred? When did udevadm load? What commands are used by udevadm, and what are the specific operations? [3.291819] pmbus 13-0058: PMBus status register not found [3.297940] pmbus 13-0059: PMBus status register not found [3.305830] usbcore: registered new interface driver usbhid [3.311417] usbhid: USB HID core driver [3.326527] aspeed_jtag: driver successfully loaded.--> load the driver success [3.335427] NET: Registered protocol family 10 [3.345639] Segment Routing with IPv6 [3.349995] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver [3.357507] NET: Registered protocol family 17 [3.362012] 8021q: 802.1Q VLAN Support v1.8 [3.379650] printk: console [netcon0] enabled [3.384027] netconsole: network logging started [3.390140] input: gpio-keys as /devices/platform/gpio-keys/input/input0 [3.398913] hctosys: unable to open rtc device (rtc0) [3.411203] Freeing unused kernel memory: 1024K [3.419068] Checked W+X mappings: passed, no W+X pages found [3.424841] Run /init as init process rofs = mtd4 squashfs rwfs = mtd5 jffs2 [4.392201] jffs2: notice: (681) jffs2_build_xattr_subsystem: complete building xattr subsystem, 8 of xdatum (0 unchecked, 1 orphan) and 11 of xref (1 dead, 0 orphan) found. [4.448757] overlayfs: upper fs does not support tmpfile. [6.760748] systemd[1]: System time before build time, advancing clock. [6.893492] systemd[1]: systemd 242-19-gdb2e367+ running in system mode. (+PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK +SYSVINIT -UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS -KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid) [6.917878] systemd[1]: Detected architecture arm. Welcome to Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) 2.7.0-dev! [7.033813] systemd[1]: Set hostname to . [7.769096] systemd[1]: File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling. [7.786341] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.) [8.942114] systemd[1]: /lib/systemd/system/phosphor-ipmi-net@.socket:3: Invalid interface name, ignoring: sys-subsystem-net-devices-%i.device [8.982380] systemd[1]: /lib/systemd/system/dbus.socket:4: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly. [9.66] systemd[1]: Reached target Fans Ready. [ OK ] Reached target Fans Ready. [9.148717] systemd[1]: Created slice system-phosphor\x2dipmi\x2dkcs.slice. [ OK ] Created slice system-phosphor\x2dipmi\x2dkcs.slice. [9.199247] systemd[1]: Listening on udev Kernel Socket. [ OK ] Listening on udev Kernel Socket. [ OK ] Reached target Slices. [ OK ] Created slice system-phosphor\x2dipmi\x2dnet.slice. [ OK ] Reached target Remote File Systems. [ OK ] Created slice system-mapper\x2dwait.slice. [ OK ] Started Forward Password R…uests to Wall Directory Watch. [ OK ] Created slice system-phosphor\x2dgpio\x2dmonitor.slice. [ OK ] Listening on Journal Socket. Mounting Kernel Configuration File System... [ OK ] Started Dispatch Password …ts to Console Directory Watch. [ OK ] Reached target Paths. [ OK ] Created slice system-phosp…dcertificate\x2dmanager.slice. [ OK ] Listening on initctl Compatibility Named Pipe. Mounting Kernel Debug File System... [ OK ] Created slice system-obmc\x2dled\x2dgroup\x2dstart.slice. [ OK ] Reached target Swap. Mounting Temporary Directory (/tmp)... [ OK ] Listening on Network Service Netlink Socket. [ OK ] Started Hardware RNG Entropy Gatherer Daemon. [ OK ] Created slice system-getty.slice. [ OK ] Listening on udev Control Socket. Starting udev Coldplug all Devices... [ OK ] Listening on Syslog Socket. [ OK ] Created slice system-obmc\x2dconsole.slice. [ OK ] Created slice system-serial\x2dgetty.slice. [ OK ] Created slice system-obmc\x2dread\x2deeprom.slice. Starting Apply Kernel Variables... Starting Remount Root and Kernel File Systems... [ OK ] Started Set initial fan speed when BMC starts.. [ OK ] Listening on Journal Socket (/dev/log). Starting Journal Service... [ OK ] Mounted Kernel Configuration File System. [ OK ] Mounted Kernel Debug File System. [ OK ] Mounted Temporary Directory (/tmp). [ OK ] Started Remount Root and Kernel File Systems. Starting Rebuild Hardware Database... Starting Create System Users... [ OK ] Started Apply Kernel Variables. [ OK ] St
Re: [systemd-devel] why the function don't have the parameter of 'value'
Dear Lennart, Thank you very much for your help. thanks, Byron At 2019-08-13 15:44:59, "Lennart Poettering" wrote: >On Di, 13.08.19 09:21, www (ouyangxua...@163.com) wrote: > >> I am looking forward to your reply. >> thanks, > >It expects that you registered an object vtable first, which lists >properties. The getters in that vtable are then called for the values. > >This is unfortunately a bit under-documented, but basically everything >defined via the SD_BUS_PROPERTY() macro for the same object path is >included (given the right flags) in the message. > >Lennart > >-- >Lennart Poettering, Berlin ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] why the function don't have the parameter of 'value'
Dear all, I am studying a open source project, and it use the systemd. when I check the property change on dbus, and I found a question, so I sent the email to ask for advice. when change the property on dbus, it use the function of "sd_bus_emit_properties_changed_strv()" ((systemd\src\libsystemd\sd-bus\bus-objects.c )). But why the function don't include a parameter of value, it just have bus, path, interface, and property-name. How does this function know what to change of the property? _public_ int sd_bus_emit_properties_changed_strv( sd_bus *bus, const char *path, const char *interface, char **names) { _cleanup_free_ char *prefix = NULL; bool found_interface = false; size_t pl; int r; .. } I am looking forward to your reply. thanks, Byron ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How can I study systemd?
Dear, I want to study the system, but I don’t know how to begin it. Who can give me some advices to study sytemd? I searched the info on the Internet and found that there was very little information about sytemd. I didn't know how to start learning systemd. Even in the github of systemd, can not get more info. I want to know that how does systemd replace init to start the whole system? How can I know the starting point of systemd code? How can I porting the systemd to the embedded linux? How can get the help info about the systemd code? thanks, Byron ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel