Questions tagged [init.d]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
8 views

How can /proc/sys values be changed at boot (sysctl.conf does this on normal Linuxes)?

How can /proc/sys values be changed at boot? sysctl.conf doesn't exist on Android and echoing values to the proc files isn't persistent.
0
votes
0answers
22 views

Adding string to init [duplicate]

I've changed some parameters in Intel p-state drivers but it resets after reboot so I decided to run it at system boot. Unfortunately I'm not sure which file to edit. echo 1 > /sys/devices/system/...
2
votes
1answer
104 views

How to make SELinux injected rules persistent without unpacking-packing boot.img?

I am working on an application that needs root access and I have a device which is rooted but not with Magisk. This device has only adb shell root available. So, I need an alternative to call the ...
1
vote
1answer
194 views

How to run an Android init service with superuser SELinux context?

I want to run an Android init service. I have a device which has rooted shell (purchased from manufacture as rooted). This device doesn't have Magisk or other su manager but adb shell is rooted and it ...
2
votes
1answer
509 views

How to run an executable on boot and keep it running?

I have an executable build from a ndk-build program. I want to run it on a rooted Android device. How much is the possibility that Android will kill my executable? Using adb shell, I am able to ...
1
vote
1answer
158 views

Adding custom bootup script to Android-x86 Nougat

I've been happy using Android-x86 Nougat on my system. Thanks to everyone who made that work. I'm now trying to make one small change which is that I want to run a custom init script (a shell script) ...
0
votes
0answers
30 views

How does init knows when to relaunch a process?

I know the Zygote listens to a socket in /dev/socket/zygote in order to know when to fork a new process. I want to know how init usually does it. I have a persistent process (not service) X whose ...
1
vote
1answer
424 views

What sepolicy context will allow any other context to access it?

I am on a bootloader locked Sprint Samsung Galaxy S7, eng boot.img flashed to phone with SELinux permissive, which gives root adb shell from where I can change system partitions, debloat, install ...
1
vote
2answers
247 views

Lengthy sleep command not working in script

I've written a su.d script to periodically (every 4 hours) back up data from an app using a looped sleep command: #!/system/bin/sh ( # Wait for boot to complete until [ "$(getprop sys....
2
votes
1answer
3k views

How to fix SELinux “avc: denied” errors when launching DNSCrypt as init.d script?

I've installed an unofficial lineage OS 14.1 ROM on my phone and i want to have dnscrypt used on boot by default. There is what i have done: Download arm binaries from: https://github.com/jedisct1/...
0
votes
1answer
142 views

Init.d Script won't work to keep value

I was try to change some value like vm, lowmemorykiller, adj, and net using shell script, then save it to init.d folder and execute it as root. after reboot, it always back to default. And i was ...
1
vote
1answer
4k views

SELinux prevents my init.rc exec command to execute

I've added a exec command at the end of init.rc file. on property:dev.bootcomplete=1 exec u:r:shell:s0 shell shell -- /system/bin/am start -n com.example.package/com.example.package.MainActivity ...
1
vote
1answer
2k views

init.rc doesn't start my service on boot completed event

I've added the following snippet to the end of /system/core/rootdir/init.rc file. on property:dev.bootcomplete=1 start bootcomplete_handler service bootcomplete_handler /system/bin/bc_handler.sh ...
0
votes
3answers
4k views

How can I run a custom .sh script at each startup (without native init.d support)?

This looks like a general concern of rookie Android system players who have just rooted their phones. The most prevalent method may be throwing your script into /system/etc/init.d. If the ROM supports ...
1
vote
1answer
73 views

Block internet access before firewall starts at boot

I have an old Android phone with Ice Cream Sandwich and DroidWall as a firewall, which makes sure that apps can't use the 3G unless I enable it for that app. DroidWall starts on boot but there is a ...
3
votes
1answer
950 views

Init.d script trouble shooting

I'm trying to run an init.d script when my rom boots to disable system services, and they aren't running. The script is as follows #!/system/bin/sh su -c pm disable com.google.android.gms/.update....
0
votes
1answer
1k views

Link2SD Mount Script Error. [4]: can't create /system/etc/init.d/11link2sd: > Not a directory

I want to move some of my apps from my internal memory to my extsdcard. I followed this to do so(I'm not using Marsh Mellow so skip the first part of the guide). When I installed Link2SD and rebooted ...
-1
votes
1answer
1k views

It seems my device doesn't have init.d support, but I have a bunch of init.* files. Can I use the same approach somehow?

-rwxr-x--- 1 root root 3265 Jan 1 1970 init.class_main.sh -rwxr-x--- 1 root root 1730 Jan 1 1970 init.mdm.sh -rwxr-x--- 1 root root 3347 Jan 1 ...
0
votes
0answers
419 views

Is it possible to start an infinite loop within init.d?

I would like to create an init.d script to control the fan of my Odroid XU3 under Lollipop 5.1.1, CyanogenMod 12.1. I already make one on linux which is working well and would like to port it to ...
2
votes
1answer
1k views

mount in /data/local/userinit.sh is not working

I want to map /sdcard/DCIM to /storage/sdcard1/DCIM using CM 12.1 on a I9100 I wrote those few lines to /data/local/userinit.sh: #!/system/bin/sh log -p i -t userinit "userinit start"; mount -o bind ...
4
votes
0answers
665 views

ifup/ifdown scripts

I am fiddeling with some network related things and want to try them on Android too. In Ubuntu it was quite easy to run some commands if an interface (eth0 or wlan0) goes up or down by simply adding ...
0
votes
1answer
5k views

remove the script in init.d

I want to flash TweakDrypT to my rooted android 4.4.2 device. But before, I must delete all the scripts in init.d. I've tried using universal init.d to remove them, but they won't. Anyone can help?
4
votes
3answers
6k views

How to create start up scripts using the init.d folder?

In this answer to a question I asked a while ago, he said it's possible to have a script executed every boot. I created a file (without extension) that contains the following: #!/system/bin/sh ...
1
vote
0answers
759 views

AutoMount ext2 SD-card on Huawei U8350 (Android 2.2.2)

On the Huawei U8350 (Android 2.2.2) the init scripts all appear to be in the root partition -- which actually is a ram disk (initramfs), so any changes to it aren't persistent across reboots. Is ...
1
vote
1answer
6k views

How to edit init.rc in Samsung Galaxy S3 i9300?

I would like to edit the init.rc in an i9300. I understand that editing the file as-is will not work as the file is reloaded from the boot image's ramdisk upon every bootup. After some googling, I ...
3
votes
1answer
746 views

init.d doesn't get executed

i am using samsung s2 and a custom rom, external sd card is mounted to /emmc but i want it to mount to /mnt/sdcard/external_sd, how could i mount it using init.d? i made a file called "99mount" with ...
2
votes
1answer
13k views

Activating swap at boot with an init.d script?

I have a rom that supports swap, but the swap script is missing. How would i make that swap script manually? I.E: What code would be in the file /etc/init.d/07swapon?