You are not logged in.

#1 2018-10-22 19:42:52

migillope
Member
Registered: 2018-10-22
Posts: 14

[SOLVED] Made a script that broke login (tty); can't find it.

Every time I login, the command "sudo ntpd -qg" is run, I have to enter root password (unless I login with root username) and am immediately shot back to the login screen.

So my time on my system was consistently wrong on start-up (probably dual-boot stuff), and running "sudo ntpd -qg" after logging in fixed it. So, I figured I'd make a script and run it on startup that will do this triviality for me. The script was something like this:

#!/bin/bash
sudo ntpd -qg
exit

I put it in /etc/profile.d and ran the following commands (according to .bash_history)

sudo nano time.sh
sudo chmod 1777 time.sh
sudo chown root:root time.sh
sudo chown -v root:root time.sh
sudo ntpd -qg

then proceeded to flounder about installing gtk3.

When I boot using an iso and navigate to /etc/profile.d, there is no time.sh. I ran "find 'time.sh' /" and got nothing. I'm not sure what to do now, as I cannot find what I assume to be the root of the issue.

Other things I did that session: installed JRE, installed gtk3-3.22, installed libreoffice.

Thank you.

Last edited by migillope (2018-10-22 21:56:31)

Offline

#2 2018-10-22 19:49:46

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Made a script that broke login (tty); can't find it.

You've to mount the installed root - /etc on the iso is /etc  of the iso - and that does of course not contain your local changes …

Offline

#3 2018-10-22 19:55:26

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Made a script that broke login (tty); can't find it.

I've run:

mount /dev/sda5 /
mount /dev/sda7 /home

Is there something more I have to do?

Offline

#4 2018-10-22 19:59:23

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Made a script that broke login (tty); can't find it.

You mounted a different partition into the root path?
Try eg. "mount  /dev/sda5 /mnt/sda5" and inspect /mnt/sda5/etc.

Offline

#5 2018-10-22 20:01:21

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Made a script that broke login (tty); can't find it.

I did that, this is the same folder as when I had it the partition mounted onto /. Still no time.sh

Offline

#6 2018-10-22 21:56:09

migillope
Member
Registered: 2018-10-22
Posts: 14

Re: [SOLVED] Made a script that broke login (tty); can't find it.

I made a really dumb mistake. I didn't reboot before remounting, I just tried to use umount. Your method worked, seth, thank you.

I guess that leads to a follow-up question: why did that script break everything in the first place? I'll do some research on my own before creating a new thread or expecting anyone to respond.
I appreciate your help.

Offline

#7 2018-10-22 23:13:36

loqs
Member
Registered: 2014-03-06
Posts: 17,327

Re: [SOLVED] Made a script that broke login (tty); can't find it.

I would hazard a guess at the issue being the script calling exit.

Offline

Board footer

Powered by FluxBB