[SOLVED] Having trouble running cron job script only works on terminal as root
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Chromium is NOT launching when sudo or su - or any sort is involved while using a bash script. I have to run Chromium without privileges, even after using --no-sandbox it crashes/segfault.
Can you provide the output when you run the /usr/bin/chromium script?
Also, as mralk3 mentioned, you could run either the /usr/bin/chromium script or the torify script with bash -x to get a ton of output that can potentially help determine your issue.
Can you provide the output when you run the /usr/bin/chromium script?
Also, as mralk3 mentioned, you could run either the /usr/bin/chromium script or the torify script with bash -x to get a ton of output that can potentially help determine your issue.
Code:
[problemchyld@darkstar:Desktop] $ /usr/bin/chromium
Fontconfig warning: FcPattern object size does not accept value 11(i)
Opening in existing browser session.
[problemchyld@darkstar:Desktop] $ su -
Password:
[root@darkstar:~] # /usr/bin/chromium
[8020:8020:0918/160026.161955:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
[root@darkstar:~] # /usr/bin/chromium --no-sandbox
Fontconfig warning: FcPattern object size does not accept value 11(i)
No protocol specified
No protocol specified
[8057:8084:0918/160043.566867:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8057:8084:0918/160043.566940:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
No protocol specified
No protocol specified
[8057:8084:0918/160043.594347:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8057:8084:0918/160043.594419:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
No protocol specified
No protocol specified
No protocol specified
No protocol specified
No protocol specified
[8057:8068:0918/160043.749780:FATAL:gpu_data_manager_impl_private.cc(442)] GPU process isn't usable. Goodbye.
#0 0x56530015feb9 (/usr/lib64/chromium/chromium+0x47d5eb8)
Received signal 6
#0 0x56530015feb9 (/usr/lib64/chromium/chromium+0x47d5eb8)
r8: 0000000000000000 r9: 0000000000000000 r10: 0000000000000008 r11: 0000000000000202
r12: 00007fbc4623ddd0 r13: 00007fbc4623cd70 r14: 00007fbc4623dde0 r15: aaaaaaaaaaaaaaaa
di: 0000000000001f79 si: 0000000000001f84 bp: 00007fbc4623cd60 bx: 00007fbc4623d5a4
dx: 0000000000000006 ax: 0000000000000000 cx: 00007fbc54d813f8 sp: 00007fbc4623cc28
ip: 00007fbc54d813f8 efl: 0000000000000202 cgf: 002b000000000033 erf: 0000000000000000
trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
Don't worry about trying to run it as root. That should not be done and we shouldn't try and diagnose issues with that.
There didn't seem to be any segfault when running it as your normal user, so what actually happens? Does chromium just never come up? If that's the case, try running the following and provide the output (there will probably be a lot of output):
If I run Chromium from the terminal without privileges this is the outcome but I have to hit enter to kill the torify script in order for chromium to launch
Code:
[problemchyld@darkstar:Desktop] $ chromium
Starting TOR...
Wait for TOR bootstrap...
Bootstrap ok!
Backup /usr/sbin/iptables rules...
Setting firewall rules...
Done!
Press any key to stop transparent proxy...
Raising maximum number of filedescriptors (ulimit -n) to 32768...
Starting Tor...
Sep 18 21:25:13.403 [notice] Tor 0.4.3.6 running on Linux with Libevent 2.0.22-stable, OpenSSL 1.0.2u, Zlib 1.2.11, Liblzma 5.2.2, and Libzstd 1.4.4.
Sep 18 21:25:13.404 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Sep 18 21:25:13.404 [notice] Read configuration file "/etc/tor/torrc".
Sep 18 21:25:13.406 [notice] Converting FascistFirewall config option to new format: "ReachableDirAddresses *:80"
Sep 18 21:25:13.406 [notice] Converting FascistFirewall config option to new format: "ReachableORAddresses *:443"
Sep 18 21:25:13.411 [notice] Opening Socks listener on 127.0.0.1:9050
Sep 18 21:25:13.411 [notice] Opened Socks listener on 127.0.0.1:9050
Clear tor rules and restore previous configuration...
Fontconfig warning: FcPattern object size does not accept value 11(i)
[5848:5848:0918/212515.183599:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
I mentioned earlier that this will require a reworking of your torify script as it will need to run in the background or exit while keeping everything working.
I mentioned earlier that this will require a reworking of your torify script as it will need to run in the background or exit while keeping everything working.
If the script exit then torify won't be running anymore, correct? So I will assume I need to run it in the background right?
If the script exit then torify won't be running anymore, correct? So I will assume I need to run it in the background right?
Backgrounding may not properly allow the script to exit when your done... I'm not exactly sure as I don't use tor and I haven't tried to script anything when running chromium.
But if you removed the following, then it should allow it to move on and start chromium without stopping all your tor stuff.
Code:
echo "Press any key to stop transparent proxy..."
read -n 1
killall tor
echo "Clear tor rules and restore previous configuration..."
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -F
iptables -X
iptables -t nat -F
iptables -t mangle -F
iptables -t raw -F
iptables --delete-chain
iptables --table nat --delete-chain
#restore previous rules
iptables-restore < backup;
#Cleaning up
rm -rf backup
rm -rf torify
rm -rf torify.log
sh /etc/rc.d/rc.unbound start
You would just need this to run after you exit chromium.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.