Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service target can not start or stop #14

Open
ExecDevOps opened this issue Sep 22, 2015 · 2 comments
Open

service target can not start or stop #14

ExecDevOps opened this issue Sep 22, 2015 · 2 comments

Comments

@ExecDevOps
Copy link

OS: CentOS 6.7
Kernel: 4.1.7-1.el6.elrepo.x86_64
targetcli: 3.0.pre4.3 (latest as of 2015-09-22)

The service "target" can not re-start or stop, failing with the following error messages:

Failed to unload target core module target_core_mod
Could not stop The Linux SCSI Target

The cause of the problem is that the module target_core_user does not get unloaded whenever the target service stops and the module target_core_mod seems to depend on it. (The modules come with the kernel and are located at /lib/modules/4.1.7-1.el6.elrepo.x86_64/kernel/drivers/target)

The problem and the solution is within the init script /etc/rc.d/init.d/target at the definition of the target core modules:

CORE_MODS="target_core_mod target_core_pscsi target_core_iblock target_core_file"

Adding target_core_user to the list of modules to load / unload when the target service starts / stops solves the problem:

CORE_MODS="target_core_mod target_core_user target_core_pscsi target_core_iblock target_core_file"

I think that the ordering of the modules in the list is important, target_core_user has to be unloaded before target_core_mod when the target service stops.

@rickysarraf
Copy link

On Debian, the same issue was seen. I've fixed the same with extending the list of modules and using modprobe instead.

@fukunagt
Copy link

fukunagt commented Aug 1, 2016

Thank you for the valuable information. I have faced the same issue on Ubuntu 16.04. And I have added the following line and fixed the issue! Thank you so much!

/etc/init.d/target
CORE_MODS="target_core_mod target_core_user target_core_pscsi target_core_iblock target_core_file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants