Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
who generates files on /etc/init.d/
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
PatomaS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2006
Posts: 128

PostPosted: Thu Jan 30, 2014 9:21 am    Post subject: who generates files on /etc/init.d/ Reply with quote

Hi

I'm having some strange issues with phpmyadmin, and tracking the problem down, I decided to change this machine from MySQL to MariaDB. SO far, that has not solved the problem, just made it more strange. But that is not the reason for this message.

The thing is that cleaning the system from MySQL, I deleted the init script on /etc/init.d assuming that after installing MariaDB it will be generated again, which didn't happen. After some thoughts, not necessarily interesting or constructive, I decided to install MySQL, just in case that package did create the init script, but again, that didn't happen.

I copied an old version I had from a backup. On that file, I found this next line which makes me think that the init script is, in deed, generated when you install the package.
Quote:

# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/mysql-5.1.67-init.d,v 1.1 2013/01/18 01:51:47 robbat2 Exp $



So, my questions are; who generates the init script? when are they generated? is it a bug that the versions 5.5.32 from MySQL and MariaDB didn't generate those init scripts?

Thanks for all.

Bye
_________________
¡ hey, hou, hou, hey !
Back to top
View user's profile Send private message
i4dnf
Apprentice
Apprentice


Joined: 18 Sep 2005
Posts: 271
Location: Bucharest, Romania

PostPosted: Thu Jan 30, 2014 10:18 am    Post subject: Reply with quote

From the header line it appears dev-db/mysql-init-scripts is the package installing the init scripts. Both mysql and MariaDB depend on it.

Another way to find out to which package a file belongs is to emerge gentoolkit and then do:

Code:
equery b /path/to/file


In your case that would be something like this (for the mysql init.d script):

Code:
equery b /etc/init.d/mysql

* Searching for /etc/init.d/mysql ...
dev-db/mysql-init-scripts-2.0_pre1-r6 (/etc/init.d/mysql)

_________________
"The only difference between me and a madman is that I am not MAD" (SALVATOR DALI)
Back to top
View user's profile Send private message
PatomaS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2006
Posts: 128

PostPosted: Thu Jan 30, 2014 12:30 pm    Post subject: Reply with quote

Hi

Thanks for the answer, it adds some more to my knowledge and perception that there is so much I still don't know.

Although, I still can't see the relation to my question. I would imagine that the package, dev-db/mysql-init-scripts has something to do, but when is it called? or why it didn't work when I installed MariaDB or MySQL?.

I can see on the ebuild that it has some work to do on /etc/init.d/ but as mentioned, why it didn't work when I installed both/any of the packages?.

May be I just need to sleep a bit and I'll see it in the morning, but for now, I don't get it.

Thanks

Bye
_________________
¡ hey, hou, hou, hey !
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu Jan 30, 2014 2:17 pm    Post subject: Reply with quote

dev-db/mysql-init-scripts was installed as a dependency, removing MySQL did not remove it, you should have used emerge -c to clean up.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
PatomaS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2006
Posts: 128

PostPosted: Thu Jan 30, 2014 11:02 pm    Post subject: Reply with quote

Hi

Certainly I should have done a --depclean and check what was there. Although, shouldn't the MySQL and MariaDB packages call/launch the execution of the init-scripts?

Bye
_________________
¡ hey, hou, hou, hey !
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Jan 31, 2014 12:14 am    Post subject: Reply with quote

No, it was already installed.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
PatomaS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2006
Posts: 128

PostPosted: Fri Jan 31, 2014 6:59 am    Post subject: Reply with quote

Hi

I don't want to sound rude, just want to get the idea clear.

You are saying that since dev-db/mysql-init-scripts was already on the system, emerging MySQL or MariaDB didn't have to pull it as a dependency and so, didn't trigger the execution of those scripts and the creation of the /etc/init.d/mysql file. Am I correct?.

My problem with that is two-fold. One, if the execution of the scripts is important, and I would say it is, something should trigger their execution or at least check if their execution is required and act according to the results when you emerge MySQL/MariaDB. Two, after doing the same original steps -- removing MySQL/MariaDB and without /etc/init.d/mysql-- I emerge manually dev-db/mysql-init-scripts and nothing happened, which to me indicates that just emerging the package is not enough.

But there is already some relation between MySQL/MariaDB and dev-db/mysql-init-scripts that triggers the creation of /etc/init.d/mysql when the system is completely clean and you do an emerge of the MySQL/MariaDB package and it pulls dev-db/mysql-init-scripts along.

Bye
_________________
¡ hey, hou, hou, hey !
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Fri Jan 31, 2014 2:05 pm    Post subject: Reply with quote

What should happen in your Opinion?

The Init-Script ebuild just installs the init-script.

In your 1st try you removed a File belonging to a package. While installing mariadb portage looked at its database and found all dependencies allready in place.

One could add a function to portage which will check if all files of all deps are in place, but who long will this check take? Basically you would need to read every database entry and every file metadata, worst if you realy want to check if this files were not changed, you need to read them all and compare atleast a checksum.
Back to top
View user's profile Send private message
PatomaS
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2006
Posts: 128

PostPosted: Fri Jan 31, 2014 2:25 pm    Post subject: Reply with quote

Hi

It certainly sounds daunting if you mention it that way, but it can be simpler than that.

When you have none of the packages installed and you emerge MySQL/MariaDB, there is some code to trigger the execution of the init-scripts, but it only happens if dev-db/mysql-init-scripts was pulled as dependency. I think that it should happen every time you install the package ( MySQL/MariaDB ). Since the init script is not something that users change much, except in very few situations, reinstalling it seems reasonable. It can be managed by the same kind of mechanic/tool/procedure that works with etc-update or dispatch-conf. At least checking that the file exists.

Or if that seems too far fetched, at least when you reinstall manually dev-db/mysql-init-scripts, /etc/init.d/mysql should be generated again.

Bye
_________________
¡ hey, hou, hou, hey !
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Fri Jan 31, 2014 2:39 pm    Post subject: Reply with quote

So you want to reintegrate the init-package into booth of them and duplicate them. Also a rebuild of mysql/mariadb is triggered, if the script needs a change.

Remember, the problem is only triggered, because of you removing blindly files.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat Feb 01, 2014 12:18 am    Post subject: Reply with quote

Quote:
Or if that seems too far fetched, at least when you reinstall manually dev-db/mysql-init-scripts, /etc/init.d/mysql should be generated again.

Isn't this exactly what happens? In actuality, the script is not generated, it is copied from portage/dev-db/mysql-init-scripts/files/.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum