LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-18-2020, 02:23 PM   #31
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370

while troubleshooting CRON jobs, I normally redirect output to file...
For example, in crontab entry, add following at the end of your entry:

Quote:
>> /tmp/cron_output.txt 2>&1
Then, after the scheduled time, look at the contents of /tmp/cron_output.txt
 
Old 09-18-2020, 02:27 PM   #32
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Code:
bash -x your_script.sh
Save yourself some trouble and run the script in debug mode to see exactly what is going on.
 
Old 09-18-2020, 02:43 PM   #33
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by PROBLEMCHYLD View Post
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.
 
Old 09-18-2020, 04:04 PM   #34
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
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.
 
Old 09-18-2020, 04:48 PM   #35
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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):

Code:
sh -x /usr/bin/chromium
 
Old 09-18-2020, 09:17 PM   #36
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
Yes, Chromium does not launch from the script if the torify.sh is listed first in any bash or shell script. It seems they conflict with each other.
 
Old 09-18-2020, 09:29 PM   #37
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-19-2020, 03:34 PM   #38
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
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.
 
Old 09-19-2020, 06:38 PM   #39
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
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?
 
Old 09-20-2020, 03:13 PM   #40
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by PROBLEMCHYLD View Post
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.
 
Old 09-23-2020, 03:38 PM   #41
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
I created a folder

/home/problemchyld/.torium/

copied the chromium script to /home/problemchyld/.torium/ as torium

added sudo /root/torify.sh to the torium script in /home/problemchyld/.torium/

added ALL ALL=NOPASSWD: /root/torify.sh to /etc/sudoers

use the chromium.desktop and renamed it to torium.desktop

changed the default icon to Incognito

Now when I launch torium, tor and unbound is processed

Since I have a web gui for iptables, I auto load the default/backup when done using tor.

I don't need to kill the tor process because I use snowflake to help the ones who need it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job Not Running - Looks Like Cron Tried Noble User Linux - Newbie 7 10-26-2014 10:26 AM
Having trouble setting an environment variable with a cron job PaulB0 Linux - Newbie 5 06-23-2012 02:06 AM
Keep getting errors when running cron job that works in normal terminal. Techno Guy Linux - Newbie 6 05-31-2009 06:48 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Command not working in cron job, but works fine in root Roosta21 Linux - Software 4 11-22-2007 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration