how to change system default setting by modify source code (or script)?

  • i want to change system default setting ,such as /etc/systemd/logind.conf.

    it is:

    Code
    [Login]
    #NAutoVTs=6
    #ReserveVT=6
    #KillUserProcesses=yes

    i want to enable some lines:

    Code
    [Login]
    NAutoVTs=6
    ReserveVT=6
    KillUserProcesses=yes

    so i checked package.mk of systemd,but it don't change these lines.

    i checked many files/scripts about systemd directory(packages , scripts,config,build.LibreELEC-xxxx-devel,projects....)

    and i search logind.conf in all directorys and changed every file i found ,then recompiling ,but it change back at last.

    there are so many system config files, i don't know which scripts or files to generate these config files and how they generate defconfig files.

    what can i do to change this file ? or which files should i to view to find it how to work?

    Edited once, last by pipipapa (February 2, 2018 at 12:31 PM).

  • After LibreELEC.tv/package.mk at master · LibreELEC/LibreELEC.tv · GitHub add lines

    Code
    sed -e "s,^.*NAutoVTs=.*$,NAutoVTs=6,g" -i $INSTALL/etc/systemd/logind.conf
    sed -e "s,^.*ReserveVT=.*$,ReserveVT=6,g" -i $INSTALL/etc/systemd/logind.conf
    sed -e "s,^.*KillUserProcesses=.*$,KillUserProcesses=yes,g" -i $INSTALL/etc/systemd/logind.conf

    The other option is to just use custom file in projects/YOUR_PROJECT/filesystem/etc/systemd.

    it work,thank!